summaryrefslogtreecommitdiff
path: root/tests/test_ext_autodoc_autoclass.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-09-21 21:47:58 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-09 02:34:49 +0900
commite2bf9166da3e89eb7cbe7abb9c1e47e34351bbf8 (patch)
tree974466008fe9453f5171721c370a984e9f25f014 /tests/test_ext_autodoc_autoclass.py
parent5337e3848cce988d18a048aaa7a258b275d67e6d (diff)
downloadsphinx-git-e2bf9166da3e89eb7cbe7abb9c1e47e34351bbf8.tar.gz
Fix #8219: autodoc: Parameters for generic base class are not shown
Diffstat (limited to 'tests/test_ext_autodoc_autoclass.py')
-rw-r--r--tests/test_ext_autodoc_autoclass.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_ext_autodoc_autoclass.py b/tests/test_ext_autodoc_autoclass.py
index 76f01f5b3..fdbff1186 100644
--- a/tests/test_ext_autodoc_autoclass.py
+++ b/tests/test_ext_autodoc_autoclass.py
@@ -9,6 +9,8 @@
:license: BSD, see LICENSE for details.
"""
+import sys
+
import pytest
from test_ext_autodoc import do_autodoc
@@ -73,3 +75,20 @@ def test_decorators(app):
' :module: target.decorator',
'',
]
+
+
+@pytest.mark.skipif(sys.version_info < (3, 7), reason='python 3.7+ is required.')
+@pytest.mark.sphinx('html', testroot='ext-autodoc')
+def test_show_inheritance_for_subclass_of_generic_type(app):
+ options = {'show-inheritance': True}
+ actual = do_autodoc(app, 'class', 'target.classes.Quux', options)
+ assert list(actual) == [
+ '',
+ '.. py:class:: Quux(iterable=(), /)',
+ ' :module: target.classes',
+ '',
+ ' Bases: :class:`List`\\ [:obj:`Union`\\ [:class:`int`, :class:`float`]]',
+ '',
+ ' A subclass of List[Union[int, float]]',
+ '',
+ ]