summaryrefslogtreecommitdiff
path: root/tests/test_domain_py.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-05-11 02:35:15 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-05-11 02:35:15 +0900
commit71e732014ffe5a58a0c52ac16c948ef13d99d19d (patch)
tree9c8cf9a89bf703950f2902f7f12e8f372ba14dd8 /tests/test_domain_py.py
parenta02d2441e2a61381fc8f8c4e24c49c7c0cf8785d (diff)
parentd627a5fe842e19c469b45ad74e47639d1b8ee390 (diff)
downloadsphinx-git-71e732014ffe5a58a0c52ac16c948ef13d99d19d.tar.gz
Merge branch '4.0.x' into 4.x
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r--tests/test_domain_py.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
index e5616a6eb..569390c40 100644
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -236,6 +236,17 @@ def test_domain_py_find_obj(app, status, warning):
('roles', 'NestedParentA.NestedChildA.subchild_1', 'method', False))])
+@pytest.mark.sphinx('html', testroot='domain-py', freshenv=True)
+def test_domain_py_canonical(app, status, warning):
+ app.builder.build_all()
+
+ content = (app.outdir / 'canonical.html').read_text()
+ assert ('<a class="reference internal" href="#canonical.Foo" title="canonical.Foo">'
+ '<code class="xref py py-class docutils literal notranslate">'
+ '<span class="pre">Foo</span></code></a>' in content)
+ assert warning.getvalue() == ''
+
+
def test_get_full_qualified_name():
env = Mock(domaindata={})
domain = PythonDomain(env)