diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-11 02:35:15 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-11 02:35:15 +0900 |
| commit | 71e732014ffe5a58a0c52ac16c948ef13d99d19d (patch) | |
| tree | 9c8cf9a89bf703950f2902f7f12e8f372ba14dd8 /tests | |
| parent | a02d2441e2a61381fc8f8c4e24c49c7c0cf8785d (diff) | |
| parent | d627a5fe842e19c469b45ad74e47639d1b8ee390 (diff) | |
| download | sphinx-git-71e732014ffe5a58a0c52ac16c948ef13d99d19d.tar.gz | |
Merge branch '4.0.x' into 4.x
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/roots/test-domain-py/canonical.rst | 9 | ||||
| -rw-r--r-- | tests/roots/test-domain-py/index.rst | 3 | ||||
| -rw-r--r-- | tests/test_domain_py.py | 11 |
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/roots/test-domain-py/canonical.rst b/tests/roots/test-domain-py/canonical.rst new file mode 100644 index 000000000..eff783aad --- /dev/null +++ b/tests/roots/test-domain-py/canonical.rst @@ -0,0 +1,9 @@ +caninical +========= + +:py:class:`.Foo` + +.. py:module:: canonical + +.. py:class:: Foo + :canonical: original.module.Foo diff --git a/tests/roots/test-domain-py/index.rst b/tests/roots/test-domain-py/index.rst index 35a0c1927..b24bbea24 100644 --- a/tests/roots/test-domain-py/index.rst +++ b/tests/roots/test-domain-py/index.rst @@ -5,3 +5,6 @@ test-domain-py roles module + module_option + abbr + canonical 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) |
