Replies: 2 comments 3 replies
-
Can you show the full output of when it works and when it does not? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This one is when the test file is located in the root directory of the package: This one is when the test file is in the subfolder: |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, all!
Met an uneasy error. There is a Python package with a
test
subfolder. In the subfolder there is a filetest_suite_13.py
with a dummy test:When I'm trying to run the test with a simple command
pytest test/test_suite_13.py
I'm gettingcollected 0 items
. The same applies to the commandpytest test
.But if I'll move this file to the root of the package and run
pytest test_suite_13.py
it works just fine!Of course, I know the pytest naming conventions, I've tried different variants of a configuration file and I've also tried to rename files and folders to something else (starting and ending with
test
, lack oftest
, etc.). Nothing is working. What can you advice?P.S.
The most weird thing is that in fact the test file is way more complex than the dummy script I've posted, and there are two test files (
test_suite_13.py
andtest_suite_14.py
) in mytest
folder, almost they same, just used for testing different versions of the same package. They have insignificant difference deep in the base classes, but they are executed in the same way. And still, one of them is collected correctly and all the tests are passing, while another one is alwayscollected 0 items
. No meaningful difference between them noticed, so we're quite lost here.Python version: 3.7
Pytest version: the last one
OS: both Windows 11 and the last Linux
Beta Was this translation helpful? Give feedback.
All reactions