mirror of
https://github.com/python/cpython.git
synced 2025-08-07 10:28:42 +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
|
@ -77,8 +77,8 @@ def needs_symlinks(fn):
|
|||
|
||||
class UnsupportedOperationTest(unittest.TestCase):
|
||||
def test_is_notimplemented(self):
|
||||
self.assertTrue(issubclass(pathlib.UnsupportedOperation, NotImplementedError))
|
||||
self.assertTrue(isinstance(pathlib.UnsupportedOperation(), NotImplementedError))
|
||||
self.assertIsSubclass(pathlib.UnsupportedOperation, NotImplementedError)
|
||||
self.assertIsInstance(pathlib.UnsupportedOperation(), NotImplementedError)
|
||||
|
||||
|
||||
class LazyImportTest(unittest.TestCase):
|
||||
|
@ -300,8 +300,8 @@ class PurePathTest(unittest.TestCase):
|
|||
clsname = p.__class__.__name__
|
||||
r = repr(p)
|
||||
# The repr() is in the form ClassName("forward-slashes path").
|
||||
self.assertTrue(r.startswith(clsname + '('), r)
|
||||
self.assertTrue(r.endswith(')'), r)
|
||||
self.assertStartsWith(r, clsname + '(')
|
||||
self.assertEndsWith(r, ')')
|
||||
inner = r[len(clsname) + 1 : -1]
|
||||
self.assertEqual(eval(inner), p.as_posix())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue