summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2016-04-09 17:24:34 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2016-11-02 21:43:33 +0200
commita1f6baaa8183e32e39dedede577955a2765f5d96 (patch)
treeee850c3d0fb8fefa6ac4fc7a1d4a97d90138f452 /tests/test_autodoc.py
parent0f35b9450010cd443205ed475c896b8a45697ef1 (diff)
downloadsphinx-git-a1f6baaa8183e32e39dedede577955a2765f5d96.tar.gz
Fix annotations formatting for plain typing.Callable
The typing.Callable class may be used without generic arguments, in which case it is equivalent to collections.abc.Callable.
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index 2b5d80efb..d2ba95608 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -1069,7 +1069,7 @@ def test_type_hints():
from sphinx.util.inspect import getargspec
try:
- from typing_test_data import f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10
+ from typing_test_data import f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11
except (ImportError, SyntaxError):
raise SkipTest('Cannot import Python code with function annotations')
@@ -1104,10 +1104,11 @@ def test_type_hints():
# Callable types
verify_arg_spec(f8, '(x: typing.Callable[[int, str], int]) -> None')
+ verify_arg_spec(f9, '(x: typing.Callable) -> None')
# Tuple types
- verify_arg_spec(f9, '(x: typing.Tuple[int, str],'
- ' y: typing.Tuple[int, ...]) -> None')
+ verify_arg_spec(f10, '(x: typing.Tuple[int, str],'
+ ' y: typing.Tuple[int, ...]) -> None')
# Instance annotations
- verify_arg_spec(f10, '(x: CustomAnnotation, y: 123) -> None')
+ verify_arg_spec(f11, '(x: CustomAnnotation, y: 123) -> None')