Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Feature or enhancement
Currently you can use--match and--ignore options for positive and negative filtering of test cases by name. But negative patterns always win. So you can select a class of tests and then exclude some tests from it, but you cannot exclude a class of tests except some tests.
Many programs that have similar options (can also be named--include/--exclude) use different algorithm. They apply rules in the order, and the last rule wins. I propose to implement this in Python regrtests too. Examples:
RunFileTests tests intest_os, excludingtest_write:
./python -m test test_os -m FileTests -i test_writeRun all tests intest_os, excludingFileTests tests, but includingtest_write:
./python -m test test_os -i FileTests -m test_writeAnd, of course, any combinations are valid. This applies also to options that read patterns from files:--matchfile and--ignorefile. The implementation is actually somewhat simpler than the current one.
Linked PRs
- gh-110918: regrtest: allow to intermix --match and --ignore options #110919
- [3.12] gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919) #111167
- [3.11] gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919) #111168
- gh-110918: Fix side effects of regrtest test_match_tests() #116718
- [3.12] gh-110918: Fix side effects of regrtest test_match_tests() (GH-116718) #116726
- [3.11] gh-110918: Fix side effects of regrtest test_match_tests() (GH-116718) #116727