diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_decorators.py | 12 | ||||
-rw-r--r-- | Lib/test/test_pydoc.py | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Lib/test/test_decorators.py b/Lib/test/test_decorators.py index 7d0243ab199..d4353457933 100644 --- a/Lib/test/test_decorators.py +++ b/Lib/test/test_decorators.py @@ -91,14 +91,18 @@ class TestDecorators(unittest.TestCase): getattr(func, attr)) self.assertEqual(repr(wrapper), format_str.format(func)) - - self.assertRaises(TypeError, wrapper, 1) + return wrapper def test_staticmethod(self): - self.check_wrapper_attrs(staticmethod, '<staticmethod({!r})>') + wrapper = self.check_wrapper_attrs(staticmethod, '<staticmethod({!r})>') + + # bpo-43682: Static methods are callable since Python 3.10 + self.assertEqual(wrapper(1), 1) def test_classmethod(self): - self.check_wrapper_attrs(classmethod, '<classmethod({!r})>') + wrapper = self.check_wrapper_attrs(classmethod, '<classmethod({!r})>') + + self.assertRaises(TypeError, wrapper, 1) def test_dotted(self): decorators = MiscDecorators() diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index e94ebd30160..9bde0c75bc9 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1142,7 +1142,7 @@ class TestDescriptions(unittest.TestCase): '''A static method''' ... self.assertEqual(self._get_summary_lines(X.__dict__['sm']), - 'sm(...)\n' + 'sm(x, y)\n' ' A static method\n') self.assertEqual(self._get_summary_lines(X.sm), """\ sm(x, y) |