diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-11 01:06:42 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-11 01:15:14 +0900 |
commit | 4ab0dba7555356e9f4ff2946a6b43fe4d1c82c78 (patch) | |
tree | 970248a89875590c2e642895b32d08e4dba54060 /tests/test_domain_py.py | |
parent | d2c8cd3c803b27537a4d6f871279fce93d503d82 (diff) | |
download | sphinx-git-4ab0dba7555356e9f4ff2946a6b43fe4d1c82c78.tar.gz |
Fix #9205: py domain: canonical option causes xref resolution error
The :canonical: option causes "more than one target for
cross-reference" warning because the class having the same name is
registered.
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r-- | tests/test_domain_py.py | 11 |
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) |