inspect.signature: Make sure that if a callable object has '_patialmethod'

attribute, that attribute is an instance of 'functools.partialmethod'.
This commit is contained in:
Yury Selivanov 2014-01-29 12:18:59 -05:00
parent c45873e434
commit 0486f819c9
2 changed files with 17 additions and 11 deletions

View file

@ -1983,6 +1983,11 @@ class TestSignatureObject(unittest.TestCase):
('c', 1, ..., 'keyword_only')),
'spam'))
def test_signature_on_fake_partialmethod(self):
def foo(a): pass
foo._partialmethod = 'spam'
self.assertEqual(str(inspect.signature(foo)), '(a)')
def test_signature_on_decorated(self):
import functools