diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-30 03:16:55 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-30 03:46:55 +0900 |
commit | 201f61f7226c764769f1b0be4e5d1918d38ff1f2 (patch) | |
tree | 5dec8627236dcc263b747fda5a9ef0b45d6d67f4 /tests/test_domain_py.py | |
parent | 2809b30c17a8fe362910f40b91fa2c17012d3ef1 (diff) | |
download | sphinx-git-201f61f7226c764769f1b0be4e5d1918d38ff1f2.tar.gz |
Fix #9280: py domain: "exceptions" module is not displayed
Since v0.2, python domain gives a special treatment for the exceptions
module to suppress its name on documenting exception classes. It had
been worthy on python2 era. But the module has been removed since
python3. Therefore, the special treatment becomes harmful for user
libraries. This removes it to render module names correctly.
Note: Now we've only supported python3. So this is not incompatible.
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r-- | tests/test_domain_py.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index 52ec0c2d4..e66f066d4 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -477,23 +477,11 @@ def test_optional_pyfunction_signature(app): def test_pyexception_signature(app): - text = ".. py:exception:: exceptions.IOError" - doctree = restructuredtext.parse(app, text) - assert_node(doctree, (addnodes.index, - [desc, ([desc_signature, ([desc_annotation, "exception "], - [desc_addname, "exceptions."], - [desc_name, "IOError"])], - desc_content)])) - assert_node(doctree[1], desc, desctype="exception", - domain="py", objtype="exception", noindex=False) - - -def test_exceptions_module_is_ignored(app): - text = (".. py:exception:: IOError\n" - " :module: exceptions\n") + text = ".. py:exception:: builtins.IOError" doctree = restructuredtext.parse(app, text) assert_node(doctree, (addnodes.index, [desc, ([desc_signature, ([desc_annotation, "exception "], + [desc_addname, "builtins."], [desc_name, "IOError"])], desc_content)])) assert_node(doctree[1], desc, desctype="exception", |