diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-05-14 23:45:46 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-05-15 00:00:51 +0900 |
commit | 358e5824900a5fe14cace232aac5728e615862c0 (patch) | |
tree | cc0bf379bc1868e894e349a0227bd2bdd87cf199 /tests/test_domain_py.py | |
parent | af9df449ea7c1c0dca7ebc39d66bc162a45bec4b (diff) | |
download | sphinx-git-358e5824900a5fe14cace232aac5728e615862c0.tar.gz |
Add :abstractmethod: option to py:method directive (refs: #6138)
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r-- | tests/test_domain_py.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index fac8a838f..12f05cf85 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -335,7 +335,9 @@ def test_pymethod_options(app): " .. py:method:: meth4\n" " :async:\n" " .. py:method:: meth5\n" - " :property:\n") + " :property:\n" + " .. py:method:: meth6\n" + " :abstractmethod:\n") domain = app.env.get_domain('py') doctree = restructuredtext.parse(app, text) assert_node(doctree, (addnodes.index, @@ -350,6 +352,8 @@ def test_pymethod_options(app): addnodes.index, desc, addnodes.index, + desc, + addnodes.index, desc)])])) # method @@ -400,6 +404,16 @@ def test_pymethod_options(app): assert 'Class.meth5' in domain.objects assert domain.objects['Class.meth5'] == ('index', 'method') + # :abstractmethod: + assert_node(doctree[1][1][10], addnodes.index, + entries=[('single', 'meth6() (Class method)', 'Class.meth6', '', None)]) + assert_node(doctree[1][1][11], ([desc_signature, ([desc_annotation, "abstract "], + [desc_name, "meth6"], + [desc_parameterlist, ()])], + [desc_content, ()])) + assert 'Class.meth6' in domain.objects + assert domain.objects['Class.meth6'] == ('index', 'method') + def test_pyclassmethod(app): text = (".. py:class:: Class\n" |