diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2025-05-22 13:17:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-22 13:17:22 +0300 |
commit | 2602d8ae981c4bae1cada2c174b367d97f712efb (patch) | |
tree | b4b9f49c391469ee1fa894a85303916e47201aa1 /Lib/test/test_structseq.py | |
parent | bb244fd33d3eb67923ec3253568867bfaed9895f (diff) | |
download | cpython-2602d8ae981c4bae1cada2c174b367d97f712efb.tar.gz cpython-2602d8ae981c4bae1cada2c174b367d97f712efb.zip |
gh-71339: Use new assertion methods in tests (GH-129046)
Diffstat (limited to 'Lib/test/test_structseq.py')
-rw-r--r-- | Lib/test/test_structseq.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py index d0bc0bd7b61..9622151143c 100644 --- a/Lib/test/test_structseq.py +++ b/Lib/test/test_structseq.py @@ -42,7 +42,7 @@ class StructSeqTest(unittest.TestCase): # os.stat() gives a complicated struct sequence. st = os.stat(__file__) rep = repr(st) - self.assertTrue(rep.startswith("os.stat_result")) + self.assertStartsWith(rep, "os.stat_result") self.assertIn("st_mode=", rep) self.assertIn("st_ino=", rep) self.assertIn("st_dev=", rep) @@ -307,7 +307,7 @@ class StructSeqTest(unittest.TestCase): self.assertEqual(t5.tm_mon, 2) # named invisible fields - self.assertTrue(hasattr(t, 'tm_zone'), f"{t} has no attribute 'tm_zone'") + self.assertHasAttr(t, 'tm_zone') with self.assertRaisesRegex(AttributeError, 'readonly attribute'): t.tm_zone = 'some other zone' self.assertEqual(t2.tm_zone, t.tm_zone) |