diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 2 | ||||
-rw-r--r-- | Lib/test/test_functools.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 88c85a3..c92bc81 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -2364,7 +2364,7 @@ class HandleTests(test_utils.TestCase): h = asyncio.Handle(cb, (), self.loop) cb_regex = r'<function HandleTests.test_handle_repr .*>' - cb_regex = fr'functools.partialmethod\({cb_regex}, , \)\(\)' + cb_regex = fr'functools.partialmethod\({cb_regex}\)\(\)' regex = fr'^<Handle {cb_regex} at {re.escape(filename)}:{lineno}>$' self.assertRegex(repr(h), regex) diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index 26701ea..559213f 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -569,6 +569,14 @@ class TestPartialMethod(unittest.TestCase): method = functools.partialmethod(func=capture, a=1) def test_repr(self): + self.assertEqual(repr(vars(self.A)['nothing']), + 'functools.partialmethod({})'.format(capture)) + self.assertEqual(repr(vars(self.A)['positional']), + 'functools.partialmethod({}, 1)'.format(capture)) + self.assertEqual(repr(vars(self.A)['keywords']), + 'functools.partialmethod({}, a=2)'.format(capture)) + self.assertEqual(repr(vars(self.A)['spec_keywords']), + 'functools.partialmethod({}, self=1, func=2)'.format(capture)) self.assertEqual(repr(vars(self.A)['both']), 'functools.partialmethod({}, 3, b=4)'.format(capture)) |