diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-10-15 22:03:56 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-10-15 23:40:05 +0900 |
commit | 793792fafc8c354a870240ab16d299df206e70c4 (patch) | |
tree | fce51604a57941b470c5cab00c37fe4896122488 /tests/test_util_inspect.py | |
parent | 8c56fd87479291e2e6b901d3ed44e889d27801da (diff) | |
download | sphinx-git-793792fafc8c354a870240ab16d299df206e70c4.tar.gz |
Fix #5480: autodoc: unable to find type hints for unresolvable Forward references
Diffstat (limited to 'tests/test_util_inspect.py')
-rw-r--r-- | tests/test_util_inspect.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py index 99033fb6e..397560d94 100644 --- a/tests/test_util_inspect.py +++ b/tests/test_util_inspect.py @@ -232,7 +232,7 @@ def test_Signature_partialmethod(): reason='type annotation test is available on py34 or above') def test_Signature_annotations(): from typing_test_data import ( - f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, Node) + f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, Node) # Class annotations sig = inspect.Signature(f0).format_args() @@ -297,6 +297,10 @@ def test_Signature_annotations(): sig = inspect.Signature(f14).format_args() assert sig == '() -> Any' + # ForwardRef + sig = inspect.Signature(f15).format_args() + assert sig == '(x: Unknown, y: int) -> Any' + # type hints by string sig = inspect.Signature(Node.children).format_args() if (3, 5, 0) <= sys.version_info < (3, 5, 3): |