summaryrefslogtreecommitdiff
path: root/tests/test_autodoc.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-04-26 23:53:36 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-04-28 01:24:41 +0900
commit767864b0f1a283122aaf000fcec9bcb604ffc8e5 (patch)
treea077397f47757f17cd42615b3af6811332325479 /tests/test_autodoc.py
parent87308d960706c72dcdebb2eb3249d3df6684e3bf (diff)
downloadsphinx-git-767864b0f1a283122aaf000fcec9bcb604ffc8e5.tar.gz
Close #7143: autodoc: Support final classes and methods
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r--tests/test_autodoc.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index 51ae3ddc3..cbbdbb787 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -1691,3 +1691,36 @@ def test_cython():
' Docstring.',
'',
]
+
+
+@pytest.mark.skipif(sys.version_info < (3, 8),
+ reason='typing.final is available since python3.8')
+@pytest.mark.usefixtures('setup_test')
+def test_final():
+ options = {"members": None}
+ actual = do_autodoc(app, 'module', 'target.final', options)
+ assert list(actual) == [
+ '',
+ '.. py:module:: target.final',
+ '',
+ '',
+ '.. py:class:: Class',
+ ' :module: target.final',
+ ' :final:',
+ '',
+ ' docstring',
+ '',
+ '',
+ ' .. py:method:: Class.meth1()',
+ ' :module: target.final',
+ ' :final:',
+ '',
+ ' docstring',
+ '',
+ '',
+ ' .. py:method:: Class.meth2()',
+ ' :module: target.final',
+ '',
+ ' docstring',
+ '',
+ ]