aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 333179a71e3..88b5b0e6e35 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -818,7 +818,7 @@ class StatAttributeTests(unittest.TestCase):
self.assertEqual(ctx.exception.errno, errno.EBADF)
def check_file_attributes(self, result):
- self.assertTrue(hasattr(result, 'st_file_attributes'))
+ self.assertHasAttr(result, 'st_file_attributes')
self.assertTrue(isinstance(result.st_file_attributes, int))
self.assertTrue(0 <= result.st_file_attributes <= 0xFFFFFFFF)
@@ -2181,7 +2181,7 @@ class GetRandomTests(unittest.TestCase):
self.assertEqual(empty, b'')
def test_getrandom_random(self):
- self.assertTrue(hasattr(os, 'GRND_RANDOM'))
+ self.assertHasAttr(os, 'GRND_RANDOM')
# Don't test os.getrandom(1, os.GRND_RANDOM) to not consume the rare
# resource /dev/random
@@ -5431,8 +5431,8 @@ class TestPEP519(unittest.TestCase):
def test_pathlike(self):
self.assertEqual('#feelthegil', self.fspath(FakePath('#feelthegil')))
- self.assertTrue(issubclass(FakePath, os.PathLike))
- self.assertTrue(isinstance(FakePath('x'), os.PathLike))
+ self.assertIsSubclass(FakePath, os.PathLike)
+ self.assertIsInstance(FakePath('x'), os.PathLike)
def test_garbage_in_exception_out(self):
vapor = type('blah', (), {})
@@ -5458,8 +5458,8 @@ class TestPEP519(unittest.TestCase):
# true on abstract implementation.
class A(os.PathLike):
pass
- self.assertFalse(issubclass(FakePath, A))
- self.assertTrue(issubclass(FakePath, os.PathLike))
+ self.assertNotIsSubclass(FakePath, A)
+ self.assertIsSubclass(FakePath, os.PathLike)
def test_pathlike_class_getitem(self):
self.assertIsInstance(os.PathLike[bytes], types.GenericAlias)
@@ -5469,7 +5469,7 @@ class TestPEP519(unittest.TestCase):
__slots__ = ()
def __fspath__(self):
return ''
- self.assertFalse(hasattr(A(), '__dict__'))
+ self.assertNotHasAttr(A(), '__dict__')
def test_fspath_set_to_None(self):
class Foo: