You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pytest --lf does not work if __init__.py files are present #7894
When there are failing tests in sibling sub-directories of the tests directory with __init__.py files, pytest --lf runs the failing tests from only one of the directories, not all the tests that failed on the last run. We need to use __init.py__ files if test files in different directories have the same name. But then pytest --lf fails to run as expected. If the __init__.py files are removed, then the --lf option runs all the failing tests.
Running pytest from tests/ directory reports 2 failing tests. But pytest --lf runs only 1 test - func/test_one.py - and skips the other. If the __init__.py files are removed and the test files are given different names, then pytest --lf runs both tests as expected.
Activity
bluetech commentedon Oct 14, 2020
Thanks for the detailed report @deb17. This is a duplicate of #7758, but the reproduction you provided will help in resolving it.
deb17 commentedon Oct 14, 2020
I searched a lot on Google for the issue. But the issue you mention did not show up. So I assumed no issue was present. Sorry about it!