summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-26 12:18:51 (GMT)
committerGitHub <noreply@github.com>2017-06-26 12:18:51 (GMT)
commitace56d583664f855d89d1219ece7c21c2fddcf30 (patch)
tree5f1748bb793b80f8d926df75cbe2e60acbd13974 /Lib/test/libregrtest
parent8c78aa70c888a370af18896a72cabd00e4120f09 (diff)
downloadcpython-ace56d583664f855d89d1219ece7c21c2fddcf30.zip
cpython-ace56d583664f855d89d1219ece7c21c2fddcf30.tar.gz
cpython-ace56d583664f855d89d1219ece7c21c2fddcf30.tar.bz2
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.
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r--Lib/test/libregrtest/main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index 527de17..1a77655 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -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: