mirror of
https://github.com/python/cpython.git
synced 2025-10-23 18:03:48 +00:00
gh-71339: Use new assertion methods in tests (GH-129046)
This commit is contained in:
parent
bb244fd33d
commit
2602d8ae98
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 @@ def test_repr_common(self):
|
|||
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