inspect.test.getfullargspec: Add a unittest to ensure correct annotations

handling #17481
This commit is contained in:
Yury Selivanov 2014-01-29 11:54:12 -05:00
parent d82eddcf05
commit 4cb939174c
1 changed files with 9 additions and 0 deletions

View File

@ -586,6 +586,15 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertFullArgSpecEquals(test, args_e=['spam'], formatted='(spam)')
def test_getfullargspec_signature_annos(self):
def test(a:'spam') -> 'ham': pass
spec = inspect.getfullargspec(test)
self.assertEqual(test.__annotations__, spec.annotations)
def test(): pass
spec = inspect.getfullargspec(test)
self.assertEqual(test.__annotations__, spec.annotations)
@unittest.skipIf(MISSING_C_DOCSTRINGS,
"Signature information for builtins requires docstrings")
def test_getfullargspec_builtin_methods(self):