mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-31324: Optimize support._match_test() (#4421)
* Rename support._match_test() to support.match_test(): make it public * Remove support.match_tests global variable. It is replaced with a new support.set_match_tests() function, so match_test() doesn't have to check each time if patterns were modified. * Rewrite match_test(): use different code paths depending on the kind of patterns for best performances. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
431665bf19
commit
803ddd8ce2
4 changed files with 111 additions and 15 deletions
|
@ -257,12 +257,12 @@ class Regrtest:
|
|||
if isinstance(test, unittest.TestSuite):
|
||||
self._list_cases(test)
|
||||
elif isinstance(test, unittest.TestCase):
|
||||
if support._match_test(test):
|
||||
if support.match_test(test):
|
||||
print(test.id())
|
||||
|
||||
def list_cases(self):
|
||||
support.verbose = False
|
||||
support.match_tests = self.ns.match_tests
|
||||
support.set_match_tests(self.ns.match_tests)
|
||||
|
||||
for test in self.selected:
|
||||
abstest = get_abs_module(self.ns, test)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue