diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-28 01:59:03 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-28 01:59:03 (GMT) |
commit | 507cd3cf91333d133241c8126d21c5e33001024c (patch) | |
tree | e8c25b37ea657486db628ca9f92fd4edbde74730 /Lib/test/test_inspect.py | |
parent | d663cc4848bb42a5ef7d6d887ed3304d789d4141 (diff) | |
parent | 46c759d76d02cb873bae55fac37dfe71750e3bef (diff) | |
download | cpython-507cd3cf91333d133241c8126d21c5e33001024c.zip cpython-507cd3cf91333d133241c8126d21c5e33001024c.tar.gz cpython-507cd3cf91333d133241c8126d21c5e33001024c.tar.bz2 |
Issue 24298: Fix signature() to properly unwrap wrappers around bound methods
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 9492cad..9f09b83 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -2086,6 +2086,19 @@ class TestSignatureObject(unittest.TestCase): with self.assertRaisesRegex(ValueError, 'invalid method signature'): self.signature(Test()) + def test_signature_wrapped_bound_method(self): + # Issue 24298 + class Test: + def m1(self, arg1, arg2=1) -> int: + pass + @functools.wraps(Test().m1) + def m1d(*args, **kwargs): + pass + self.assertEqual(self.signature(m1d), + ((('arg1', ..., ..., "positional_or_keyword"), + ('arg2', 1, ..., "positional_or_keyword")), + int)) + def test_signature_on_classmethod(self): class Test: @classmethod |