diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2023-04-16 22:19:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-16 22:19:44 (GMT) |
commit | ff3303e49c13495d8d9cf1dc0cf0624bbda1d3ae (patch) | |
tree | 7e54b6cec286228e8c1412bba6563efc57910e86 /Lib/test/test_unittest/test_runner.py | |
parent | a210cac77649a18bf0eb7354c9187ec91ccb078a (diff) | |
download | cpython-ff3303e49c13495d8d9cf1dc0cf0624bbda1d3ae.zip cpython-ff3303e49c13495d8d9cf1dc0cf0624bbda1d3ae.tar.gz cpython-ff3303e49c13495d8d9cf1dc0cf0624bbda1d3ae.tar.bz2 |
gh-48330: address review comments to PR-12271 (#103209)
address review comments to PR-12271
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'Lib/test/test_unittest/test_runner.py')
-rw-r--r-- | Lib/test/test_unittest/test_runner.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_unittest/test_runner.py b/Lib/test/test_unittest/test_runner.py index 1ce42a1..ceb4c8a 100644 --- a/Lib/test/test_unittest/test_runner.py +++ b/Lib/test/test_unittest/test_runner.py @@ -1367,7 +1367,7 @@ class Test_TextTestRunner(unittest.TestCase): self.assertTrue(runner.stream.stream is f) def test_durations(self): - def run(test, expect_durations): + def run(test, *, expect_durations=True): stream = BufferedWriter() runner = unittest.TextTestRunner(stream=stream, durations=5, verbosity=2) result = runner.run(test) @@ -1389,21 +1389,21 @@ class Test_TextTestRunner(unittest.TestCase): def test_1(self): pass - run(Foo('test_1'), True) + run(Foo('test_1'), expect_durations=True) # failure class Foo(unittest.TestCase): def test_1(self): self.assertEqual(0, 1) - run(Foo('test_1'), True) + run(Foo('test_1'), expect_durations=True) # error class Foo(unittest.TestCase): def test_1(self): 1 / 0 - run(Foo('test_1'), True) + run(Foo('test_1'), expect_durations=True) # error in setUp and tearDown @@ -1414,7 +1414,7 @@ class Test_TextTestRunner(unittest.TestCase): def test_1(self): pass - run(Foo('test_1'), True) + run(Foo('test_1'), expect_durations=True) # skip (expect no durations) class Foo(unittest.TestCase): @@ -1422,7 +1422,7 @@ class Test_TextTestRunner(unittest.TestCase): def test_1(self): pass - run(Foo('test_1'), False) + run(Foo('test_1'), expect_durations=False) |