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

1.33: pytest by default is not able to find any units #150

Open
kloczek opened this issue Jul 18, 2023 · 4 comments
Open

1.33: pytest by default is not able to find any units #150

kloczek opened this issue Jul 18, 2023 · 4 comments

Comments

@kloczek
Copy link

kloczek commented Jul 18, 2023

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-json-patch-1.33-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-json-patch-1.33-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-json-patch-1.33
collected 0 items

=================================================================================== no tests ran in 0.01s ===================================================================================

However ..

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-json-patch-1.33-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-json-patch-1.33-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-json-patch-1.33
collected 110 items

tests.py ..............................................................................................................                                                               [100%]

==================================================================================== 110 passed in 0.17s ====================================================================================
@stefankoegl
Copy link
Owner

Can you elaborate?

@kloczek
Copy link
Author

kloczek commented Aug 5, 2023

If by default pytest is not able to find units usually it means that names of the files to scan are not correct because pytest by default scans tests_*.py files.

@stefankoegl
Copy link
Owner

It does not seem to be based on the filename.

$ mv tests.py tests_main.py
$ pytest -ra -m 'not network'
============================== test session starts ==============================
platform darwin -- Python 3.10.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /Users/skoegl/python-json-patch
collected 0 items                                                               

============================= no tests ran in 0.00s =============================

Any other ideas?

@kloczek
Copy link
Author

kloczek commented Aug 16, 2023

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

No branches or pull requests

2 participants