summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-01-29 15:46:14 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-01-29 15:46:14 (GMT)
commitb77511da9257bae4082556e0235b23d008dfb789 (patch)
tree365ee26bea4e1c2af0a3ba7485325308ba021368 /Lib/test/test_inspect.py
parent9f2e46de34b28d20485ef4f1078c544238183537 (diff)
downloadcpython-b77511da9257bae4082556e0235b23d008dfb789.zip
cpython-b77511da9257bae4082556e0235b23d008dfb789.tar.gz
cpython-b77511da9257bae4082556e0235b23d008dfb789.tar.bz2
inspect.Signature: Make from_builtin to raise an exception if no signature can
be provided #20422
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 1325c7a..2ef3ca2 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -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):