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:
Pablo Galindo 2019-04-30 02:01:14 +01:00 committed by GitHub
parent 81c5a90595
commit d5d2b45469
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 74 additions and 61 deletions

View file

@ -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)