mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
inspect.Signature: Make from_builtin to raise an exception if no signature can
be provided #20422
This commit is contained in:
parent
9f2e46de34
commit
b77511da92
2 changed files with 24 additions and 10 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue