mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
bpo-36751: Deprecate getfullargspec and report positional-only args as regular args (GH-13016)
* bpo-36751: Deprecate getfullargspec and report positional-only args as regular args * Use inspect.signature in testhelpers
This commit is contained in:
parent
81c5a90595
commit
d5d2b45469
6 changed files with 74 additions and 61 deletions
|
@ -920,7 +920,7 @@ class SpecSignatureTest(unittest.TestCase):
|
|||
mock(1, 2)
|
||||
mock(x=1, y=2)
|
||||
|
||||
self.assertEqual(inspect.getfullargspec(mock), inspect.getfullargspec(myfunc))
|
||||
self.assertEqual(inspect.signature(mock), inspect.signature(myfunc))
|
||||
self.assertEqual(mock.mock_calls, [call(1, 2), call(x=1, y=2)])
|
||||
self.assertRaises(TypeError, mock, 1)
|
||||
|
||||
|
@ -934,7 +934,7 @@ class SpecSignatureTest(unittest.TestCase):
|
|||
mock(1, 2, c=3)
|
||||
mock(1, c=3)
|
||||
|
||||
self.assertEqual(inspect.getfullargspec(mock), inspect.getfullargspec(foo))
|
||||
self.assertEqual(inspect.signature(mock), inspect.signature(foo))
|
||||
self.assertEqual(mock.mock_calls, [call(1, 2, c=3), call(1, c=3)])
|
||||
self.assertRaises(TypeError, mock, 1)
|
||||
self.assertRaises(TypeError, mock, 1, 2, 3, c=4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue