aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 0817d0a87a3..628920e34b5 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -1107,7 +1107,7 @@ class PosixTester(unittest.TestCase):
def _test_chflags_regular_file(self, chflags_func, target_file, **kwargs):
st = os.stat(target_file)
- self.assertTrue(hasattr(st, 'st_flags'))
+ self.assertHasAttr(st, 'st_flags')
# ZFS returns EOPNOTSUPP when attempting to set flag UF_IMMUTABLE.
flags = st.st_flags | stat.UF_IMMUTABLE
@@ -1143,7 +1143,7 @@ class PosixTester(unittest.TestCase):
def test_lchflags_symlink(self):
testfn_st = os.stat(os_helper.TESTFN)
- self.assertTrue(hasattr(testfn_st, 'st_flags'))
+ self.assertHasAttr(testfn_st, 'st_flags')
self.addCleanup(os_helper.unlink, _DUMMY_SYMLINK)
os.symlink(os_helper.TESTFN, _DUMMY_SYMLINK)
@@ -2218,12 +2218,12 @@ class TestPosixWeaklinking(unittest.TestCase):
def test_pwritev(self):
self._verify_available("HAVE_PWRITEV")
if self.mac_ver >= (10, 16):
- self.assertTrue(hasattr(os, "pwritev"), "os.pwritev is not available")
- self.assertTrue(hasattr(os, "preadv"), "os.readv is not available")
+ self.assertHasAttr(os, "pwritev")
+ self.assertHasAttr(os, "preadv")
else:
- self.assertFalse(hasattr(os, "pwritev"), "os.pwritev is available")
- self.assertFalse(hasattr(os, "preadv"), "os.readv is available")
+ self.assertNotHasAttr(os, "pwritev")
+ self.assertNotHasAttr(os, "preadv")
def test_stat(self):
self._verify_available("HAVE_FSTATAT")