tarpas / pytest-testmon

Selects tests affected by changed files. Executes the right tests first. Continuous test runner when used with pytest-watch.
https://testmon.org
MIT License
800 stars 54 forks source link

`--ignore` not ignoring file in conjunction with testmon #187

Closed jacksongoode closed 1 year ago

jacksongoode commented 1 year ago

We've recently a strange result from the call pytest --ignore=test_dir/ignored_tests.py --testmon where it actually runs all the tests from ignored_test.py. The initial pytest pre-log shows the deselected tests but then collects all (110) tests. I can confirm this happens even when the testmondata was removed. This is after a library upgrade.

platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
testmon: libraries upgrade, changed files: 17, skipping collection of 29 files, environment: default
rootdir: ******, configfile: pytest.ini
plugins: testmon-1.3.4, anyio-3.6.1
collected 110 items

Should I be making this call with --testmon-forceselect?

janbernloehr commented 1 year ago

I think this was introduced in 1.34 since it was not present in 1.33.

jacksongoode commented 1 year ago

Since then, I resolved this by reverting this command back to pytest -k 'not ignored_tests.py' --testmon-forceselect for others that might need an alternative. However, in this case, the folder I want ignored is still scanned.

tarpas commented 1 year ago

released as 1.3.5dev4, install with pip install "pytest-testmon==1.3.5dev4" please