Commit 6d0b7470 authored by Xtreak's avatar Xtreak Committed by Miss Islington (bot)

bpo-37099: Silence DeprecationWarning in test_inspect (GH-13679)



Fix DeprecationWarning introduced in aee19f54


https://bugs.python.org/issue37099
parent 249b7d59
......@@ -750,12 +750,14 @@ class TestClassesAndFunctions(unittest.TestCase):
def assertArgSpecEquals(self, routine, args_e, varargs_e=None,
varkw_e=None, defaults_e=None, formatted=None):
with self.assertWarns(DeprecationWarning):
args, varargs, varkw, defaults = inspect.getargspec(routine)
self.assertEqual(args, args_e)
self.assertEqual(varargs, varargs_e)
self.assertEqual(varkw, varkw_e)
self.assertEqual(defaults, defaults_e)
if formatted is not None:
with self.assertWarns(DeprecationWarning):
self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults),
formatted)
......@@ -774,6 +776,7 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertEqual(kwonlydefaults, kwonlydefaults_e)
self.assertEqual(ann, ann_e)
if formatted is not None:
with self.assertWarns(DeprecationWarning):
self.assertEqual(inspect.formatargspec(args, varargs, varkw, defaults,
kwonlyargs, kwonlydefaults, ann),
formatted)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment