inspect.Signature: Make from_builtin to raise an exception if no signature can

be provided #20422
This commit is contained in:
Yury Selivanov 2014-01-29 10:46:14 -05:00
parent 9f2e46de34
commit b77511da92
2 changed files with 24 additions and 10 deletions

View file

@ -1667,6 +1667,10 @@ class TestSignatureObject(unittest.TestCase):
with self.assertRaisesRegex(TypeError, 'is not a Python function'):
inspect.Signature.from_function(42)
def test_signature_from_builtin_errors(self):
with self.assertRaisesRegex(TypeError, 'is not a Python builtin'):
inspect.Signature.from_builtin(42)
def test_signature_on_method(self):
class Test:
def __init__(*args):