gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919)

Test case matching patterns specified by options --match, --ignore,
--matchfile and --ignorefile are now tested in the order of
specification, and the last match determines whether the test case be run
or ignored.
This commit is contained in:
Serhiy Storchaka 2023-10-21 17:44:46 +03:00 committed by GitHub
parent b578e51f02
commit 9a1fe09622
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 128 additions and 143 deletions

View file

@ -5,7 +5,7 @@ import unittest
from test import support
from .utils import (
StrPath, TestName, TestTuple, TestList, FilterTuple,
StrPath, TestName, TestTuple, TestList, TestFilter,
abs_module_name, count, printlist)
@ -83,11 +83,10 @@ def _list_cases(suite):
print(test.id())
def list_cases(tests: TestTuple, *,
match_tests: FilterTuple | None = None,
ignore_tests: FilterTuple | None = None,
match_tests: TestFilter | None = None,
test_dir: StrPath | None = None):
support.verbose = False
support.set_match_tests(match_tests, ignore_tests)
support.set_match_tests(match_tests)
skipped = []
for test_name in tests: