Commits

1st1 committed cde2d39

pep 362: Add one more test for Parameter.replace

Comments (0)

Files changed (1)

Lib/test/test_inspect.py

             inspect.Parameter('a', default=42,
                               kind=inspect.Parameter.VAR_POSITIONAL)
 
+        p = inspect.Parameter('a', default=42,
+                              kind=inspect.Parameter.POSITIONAL_OR_KEYWORD)
+        with self.assertRaisesRegexp(ValueError, 'cannot have default values'):
+            p.replace(kind=inspect.Parameter.VAR_POSITIONAL)
+
         self.assertTrue(repr(p).startswith('<Parameter'))
 
     def test_signature_parameter_equality(self):