Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automated tests #503

Closed
wants to merge 1 commit into from
Closed

Conversation

ElishaKay
Copy link
Contributor

Run tests with:

pytest -s test_gpt_researcher.py

… each potential values of the report_type argument) - 6 reports run to completion and are printed in CLI
docx_filename = os.path.join(output_dir, f"{report_type}.docx")

# Check if the PDF and DOCX files are created
# assert os.path.exists(pdf_filename), f"PDF file not found for report type: {report_type}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ElishaKay why is this commented? Is this test final?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@assafelovic Current Tests dont write the report to docs or pdf.
Probably because they're based on the code samples from the pip documentation which merely return a string of the report

Copy link
Contributor Author

@ElishaKay ElishaKay May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those 6 use cases in the commit message above, correct, the tests are final and pass.

I needed to make a change in agent.py for those tests to pass (initialize report = "" at top of a function. If that doesn't break anything feel free to merge. Else we can continue writing tests for more use cases here.

Food for thought:

  • What are the potential parameters and values that can be passed to the GPTResearcher Class?
  • For end to end tests (fronted to backend and back), we'd be better positioned leveraging a React Testing Library

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just got me thinking that GPT Researcher should be able to expose the writing functions

@ElishaKay ElishaKay closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants