diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-03-06 18:48:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-06 18:48:04 (GMT) |
commit | 387a055261267f5fafd2c12eafef49759c94704f (patch) | |
tree | 20f5036888d149aa867dd0406d89aa993111a823 /Lib/test | |
parent | baa45079466eda1f5636a6d13f3a60c2c00fdcd3 (diff) | |
download | cpython-387a055261267f5fafd2c12eafef49759c94704f.zip cpython-387a055261267f5fafd2c12eafef49759c94704f.tar.gz cpython-387a055261267f5fafd2c12eafef49759c94704f.tar.bz2 |
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
(cherry picked from commit 8a387219bdfb6ee34928d6168ac42ca559f11c9a)
Co-authored-by: Yury Selivanov <yury@magic.io>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_inspect.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 5543674..126b26e 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -2526,6 +2526,16 @@ class TestSignatureObject(unittest.TestCase): ('c', 1, ..., 'keyword_only')), 'spam')) + class Spam: + def test(self: 'anno', x): + pass + + g = partialmethod(test, 1) + + self.assertEqual(self.signature(Spam.g), + ((('self', ..., 'anno', 'positional_or_keyword'),), + ...)) + def test_signature_on_fake_partialmethod(self): def foo(a): pass foo._partialmethod = 'spam' |