aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_timeit.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2025-05-22 13:17:22 +0300
committerGitHub <noreply@github.com>2025-05-22 13:17:22 +0300
commit2602d8ae981c4bae1cada2c174b367d97f712efb (patch)
treeb4b9f49c391469ee1fa894a85303916e47201aa1 /Lib/test/test_timeit.py
parentbb244fd33d3eb67923ec3253568867bfaed9895f (diff)
downloadcpython-2602d8ae981c4bae1cada2c174b367d97f712efb.tar.gz
cpython-2602d8ae981c4bae1cada2c174b367d97f712efb.zip
gh-71339: Use new assertion methods in tests (GH-129046)
Diffstat (limited to 'Lib/test/test_timeit.py')
-rw-r--r--Lib/test/test_timeit.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_timeit.py b/Lib/test/test_timeit.py
index f5ae0a84eb3..2aeebea9f93 100644
--- a/Lib/test/test_timeit.py
+++ b/Lib/test/test_timeit.py
@@ -222,8 +222,8 @@ class TestTimeit(unittest.TestCase):
def assert_exc_string(self, exc_string, expected_exc_name):
exc_lines = exc_string.splitlines()
self.assertGreater(len(exc_lines), 2)
- self.assertTrue(exc_lines[0].startswith('Traceback'))
- self.assertTrue(exc_lines[-1].startswith(expected_exc_name))
+ self.assertStartsWith(exc_lines[0], 'Traceback')
+ self.assertStartsWith(exc_lines[-1], expected_exc_name)
def test_print_exc(self):
s = io.StringIO()