mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.14] gh-71339: Use new assertion methods in tests (GH-129046) (GH-134498)
(cherry picked from commit 2602d8ae98
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
d5f7e80d44
commit
db98e0bb12
117 changed files with 407 additions and 445 deletions
|
@ -427,12 +427,12 @@ class TestRmTree(BaseTest, unittest.TestCase):
|
|||
else:
|
||||
self.assertIs(func, os.listdir)
|
||||
self.assertIn(arg, [TESTFN, self.child_dir_path])
|
||||
self.assertTrue(issubclass(exc[0], OSError))
|
||||
self.assertIsSubclass(exc[0], OSError)
|
||||
self.errorState += 1
|
||||
else:
|
||||
self.assertEqual(func, os.rmdir)
|
||||
self.assertEqual(arg, TESTFN)
|
||||
self.assertTrue(issubclass(exc[0], OSError))
|
||||
self.assertIsSubclass(exc[0], OSError)
|
||||
self.errorState = 3
|
||||
|
||||
@unittest.skipIf(sys.platform[:6] == 'cygwin',
|
||||
|
@ -3479,7 +3479,7 @@ class PublicAPITests(unittest.TestCase):
|
|||
"""Ensures that the correct values are exposed in the public API."""
|
||||
|
||||
def test_module_all_attribute(self):
|
||||
self.assertTrue(hasattr(shutil, '__all__'))
|
||||
self.assertHasAttr(shutil, '__all__')
|
||||
target_api = ['copyfileobj', 'copyfile', 'copymode', 'copystat',
|
||||
'copy', 'copy2', 'copytree', 'move', 'rmtree', 'Error',
|
||||
'SpecialFileError', 'make_archive',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue