diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-24 09:43:00 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-24 09:43:00 +0100 |
commit | 5de16e80c14c7698992da8b08ae169e4be1d2ca3 (patch) | |
tree | 759648090092f139da0259164d717306663592cb /Lib/test/test_regrtest.py | |
parent | 923590e397e255ae0f34a04eb662264de9b67f09 (diff) | |
download | cpython-git-5de16e80c14c7698992da8b08ae169e4be1d2ca3.tar.gz |
regrtest: fix --fromfile feature
* Update code for the name regrtest output format.
* Enhance also test_regrtest test on --fromfile
Diffstat (limited to 'Lib/test/test_regrtest.py')
-rw-r--r-- | Lib/test/test_regrtest.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 03e7e1d8a1..df8447cade 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -628,6 +628,22 @@ class ArgsTestCase(BaseTestCase): # [2/2] test_2 filename = support.TESTFN self.addCleanup(support.unlink, filename) + + # test format '0:00:00 [2/7] test_opcodes -- test_grammar took 0 sec' + with open(filename, "w") as fp: + previous = None + for index, name in enumerate(tests, 1): + line = ("00:00:%02i [%s/%s] %s" + % (index, index, len(tests), name)) + if previous: + line += " -- %s took 0 sec" % previous + print(line, file=fp) + previous = name + + output = self.run_tests('--fromfile', filename) + self.check_executed_tests(output, tests) + + # test format '[2/7] test_opcodes' with open(filename, "w") as fp: for index, name in enumerate(tests, 1): print("[%s/%s] %s" % (index, len(tests), name), file=fp) @@ -635,6 +651,14 @@ class ArgsTestCase(BaseTestCase): output = self.run_tests('--fromfile', filename) self.check_executed_tests(output, tests) + # test format 'test_opcodes' + with open(filename, "w") as fp: + for name in tests: + print(name, file=fp) + + output = self.run_tests('--fromfile', filename) + self.check_executed_tests(output, tests) + def test_interrupted(self): code = TEST_INTERRUPTED test = self.create_test("sigint", code=code) |