diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-01-29 16:54:12 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-01-29 16:54:12 (GMT) |
commit | 4cb939174c3fd45b5087ef5d2ca5c32a112b18d5 (patch) | |
tree | 77245f5b392a4a86b312bb62717042e4da42adee /Lib | |
parent | d82eddcf058deb8140e2d8670a4f2109872a2015 (diff) | |
download | cpython-4cb939174c3fd45b5087ef5d2ca5c32a112b18d5.zip cpython-4cb939174c3fd45b5087ef5d2ca5c32a112b18d5.tar.gz cpython-4cb939174c3fd45b5087ef5d2ca5c32a112b18d5.tar.bz2 |
inspect.test.getfullargspec: Add a unittest to ensure correct annotations
handling #17481
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_inspect.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 546fec5..19ccbcb 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -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): |