mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
gh-92062: inspect.Parameter
checks whether name
is a keyword (GH-92065)
Fixes #92062.
This commit is contained in:
parent
3a35b62ea0
commit
65f88a6ef7
3 changed files with 12 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue