summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-03-06 17:59:45 (GMT)
committerGitHub <noreply@github.com>2018-03-06 17:59:45 (GMT)
commit8a387219bdfb6ee34928d6168ac42ca559f11c9a (patch)
treec56b898cf5b12a681af7ca282e9f4c8ba2a14a43 /Lib/test/test_inspect.py
parent5d92647102fac9e116b98ab8bbc632eeed501c34 (diff)
downloadcpython-8a387219bdfb6ee34928d6168ac42ca559f11c9a.zip
cpython-8a387219bdfb6ee34928d6168ac42ca559f11c9a.tar.gz
cpython-8a387219bdfb6ee34928d6168ac42ca559f11c9a.tar.bz2
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 1a856f6..3481a57 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -2580,6 +2580,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'