Merge pull request #3747 from fanninpm/test-reprlib-3.10

Update test_reprlib.py to CPython 3.10
This commit is contained in:
Jeong YunWon
2022-05-26 10:32:42 +09:00
committed by GitHub

View File

@@ -198,6 +198,8 @@ class ReprTests(unittest.TestCase):
r'int object at 0x[0-9A-Fa-f]+>')
self.assertRegex(r(x), r'<cell at 0x.*\.\.\..*>')
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_descriptors(self):
eq = self.assertEqual
# method descriptors
@@ -209,9 +211,9 @@ class ReprTests(unittest.TestCase):
class C:
def foo(cls): pass
x = staticmethod(C.foo)
self.assertTrue(repr(x).startswith('<staticmethod object at 0x'))
self.assertEqual(repr(x), f'<staticmethod({C.foo!r})>')
x = classmethod(C.foo)
self.assertTrue(repr(x).startswith('<classmethod object at 0x'))
self.assertEqual(repr(x), f'<classmethod({C.foo!r})>')
def test_unsortable(self):
# Repr.repr() used to call sorted() on sets, frozensets and dicts