bpo-30523: regrtest --list-cases --match (#2401)

* regrtest --list-cases now supports --match and --match-file options.
  Example: ./python -m test --list-cases -m FileTests test_os
* --list-cases now also sets support.verbose to False to prevent
  messages to stdout when loading test modules.
* Add support._match_test() private function.
This commit is contained in:
Victor Stinner 2017-06-26 14:18:51 +02:00 committed by GitHub
parent 8c78aa70c8
commit ace56d5836
3 changed files with 32 additions and 15 deletions

View file

@ -256,9 +256,13 @@ class Regrtest:
if isinstance(test, unittest.TestSuite):
self._list_cases(test)
elif isinstance(test, unittest.TestCase):
print(test.id())
if support._match_test(test):
print(test.id())
def list_cases(self):
support.verbose = False
support.match_tests = self.ns.match_tests
for test in self.selected:
abstest = get_abs_module(self.ns, test)
try: