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:
Run FileTests tests in test_os, excluding test_write:
./python -m test test_os -m FileTests -i test_write
Run all tests in test_os, excluding FileTests tests, but including test_write:
./python -m test test_os -i FileTests -m test_write
And, 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
Feature or enhancement
Currently you can use
--matchand--ignoreoptions 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:Run
FileTeststests intest_os, excludingtest_write:Run all tests in
test_os, excludingFileTeststests, but includingtest_write:And, of course, any combinations are valid. This applies also to options that read patterns from files:
--matchfileand--ignorefile. The implementation is actually somewhat simpler than the current one.Linked PRs