summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_stat.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-22 10:42:50 (GMT)
committerGitHub <noreply@github.com>2025-05-22 10:42:50 (GMT)
commitdb98e0bb127c469842dc119d23e5daacd23862cc (patch)
tree5628e04625c93f2e5bde25aa29dedb3c154a0dec /Lib/test/test_stat.py
parentd5f7e80d4407655919b32bbd5746b23af174bc5b (diff)
downloadcpython-db98e0bb127c469842dc119d23e5daacd23862cc.zip
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.gz
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.bz2
[3.14] gh-71339: Use new assertion methods in tests (GH-129046) (GH-134498)
(cherry picked from commit 2602d8ae981c4bae1cada2c174b367d97f712efb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_stat.py')
-rw-r--r--Lib/test/test_stat.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py
index 49013a4..5fd25d5 100644
--- a/Lib/test/test_stat.py
+++ b/Lib/test/test_stat.py
@@ -157,7 +157,7 @@ class TestFilemode:
os.chmod(TESTFN, 0o700)
st_mode, modestr = self.get_mode()
- self.assertEqual(modestr[:3], '-rw')
+ self.assertStartsWith(modestr, '-rw')
self.assertS_IS("REG", st_mode)
self.assertEqual(self.statmod.S_IFMT(st_mode),
self.statmod.S_IFREG)
@@ -256,7 +256,7 @@ class TestFilemode:
"FILE_ATTRIBUTE_* constants are Win32 specific")
def test_file_attribute_constants(self):
for key, value in sorted(self.file_attributes.items()):
- self.assertTrue(hasattr(self.statmod, key), key)
+ self.assertHasAttr(self.statmod, key)
modvalue = getattr(self.statmod, key)
self.assertEqual(value, modvalue, key)
@@ -314,7 +314,7 @@ class TestFilemode:
self.assertEqual(self.statmod.S_ISGID, 0o002000)
self.assertEqual(self.statmod.S_ISVTX, 0o001000)
- self.assertFalse(hasattr(self.statmod, "S_ISTXT"))
+ self.assertNotHasAttr(self.statmod, "S_ISTXT")
self.assertEqual(self.statmod.S_IREAD, self.statmod.S_IRUSR)
self.assertEqual(self.statmod.S_IWRITE, self.statmod.S_IWUSR)
self.assertEqual(self.statmod.S_IEXEC, self.statmod.S_IXUSR)