summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorZac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>2022-05-03 20:52:30 (GMT)
committerGitHub <noreply@github.com>2022-05-03 20:52:30 (GMT)
commit65f88a6ef74c9b01017438e88e31570b02f1df9c (patch)
tree4ba6a919751b01f9b824ef836f491d899ac8362b /Lib/test/test_inspect.py
parent3a35b62ea003182c643516098cc781944d425800 (diff)
downloadcpython-65f88a6ef74c9b01017438e88e31570b02f1df9c.zip
cpython-65f88a6ef74c9b01017438e88e31570b02f1df9c.tar.gz
cpython-65f88a6ef74c9b01017438e88e31570b02f1df9c.tar.bz2
gh-92062: `inspect.Parameter` checks whether `name` is a keyword (GH-92065)
Fixes #92062.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 115e97b..fe0259a 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -3604,6 +3604,9 @@ class TestParameterObject(unittest.TestCase):
with self.assertRaisesRegex(ValueError, 'not a valid parameter name'):
inspect.Parameter('1', kind=inspect.Parameter.VAR_KEYWORD)
+ with self.assertRaisesRegex(ValueError, 'not a valid parameter name'):
+ inspect.Parameter('from', kind=inspect.Parameter.VAR_KEYWORD)
+
with self.assertRaisesRegex(TypeError, 'name must be a str'):
inspect.Parameter(None, kind=inspect.Parameter.VAR_KEYWORD)