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

[Bug]: [Low Priority] Cannot run tests from a test's local folder. conftest is not found. #1120

Closed
afourney opened this issue Jan 2, 2024 · 1 comment · Fixed by #1144
Closed
Labels
bug Something isn't working

Comments

@afourney
Copy link
Member

afourney commented Jan 2, 2024

Describe the bug

Prior to #1110, it was possible to run the tests from a test's local directory. E.g.

cd autogen/test/agentchat/contrib
python test_compressible_agent.py

or

cd autogen/test/agentchat/contrib
pytest test_compressible_agent.py

But now, doing so raises the error:

ModuleNotFoundError: No module named 'conftest'

Now, tests need to be run from the test root folder:

cd autogen/test
pytest agentchat/contrib/test_compressible_agent.py

This isn't a real problem, but it is a change in prior behavior, and it took me a minute to understand what was going on despite considerable prior experience with the tests.

Steps to reproduce

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

@afourney afourney added the bug Something isn't working label Jan 2, 2024
@afourney afourney changed the title [Bug]: [Low Priority] [Bug]: [Low Priority] Cannot run tests from a test's local folder. conftest is not found. Jan 2, 2024
@rickyloynd-microsoft
Copy link
Contributor

I just logged the same issue as #1137 without realizing it was a dup. But I would give this bug a higher priority, because we have blog posts directing users to run some of these tests, and running pytest within the test folder (as described above) is a pain, and makes debugging into these tests harder. I propose a different solution in #1137.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants