diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-07-11 12:03:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-11 12:03:40 +0900 |
| commit | f40c2837dcd19713573bd636bc220a41db41cd61 (patch) | |
| tree | e8fa8e5922912642031ec1ddc04e5898c2193bca /tests | |
| parent | 5aed23d6818e349fabd083358dfa30b547d393a2 (diff) | |
| parent | 9aedeee53891bcbbba0b0adaf72a3e30f99a00f7 (diff) | |
| download | sphinx-git-f40c2837dcd19713573bd636bc220a41db41cd61.tar.gz | |
Merge pull request #9225 from doerwalter/typehint-html
Add HTML markup to method/function return typehint
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/roots/test-html_signaturereturn_icon/conf.py | 1 | ||||
| -rw-r--r-- | tests/roots/test-html_signaturereturn_icon/index.rst | 4 | ||||
| -rw-r--r-- | tests/test_build_html.py | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/roots/test-html_signaturereturn_icon/conf.py b/tests/roots/test-html_signaturereturn_icon/conf.py new file mode 100644 index 000000000..a695d1804 --- /dev/null +++ b/tests/roots/test-html_signaturereturn_icon/conf.py @@ -0,0 +1 @@ +extensions = ['sphinx.ext.autodoc'] diff --git a/tests/roots/test-html_signaturereturn_icon/index.rst b/tests/roots/test-html_signaturereturn_icon/index.rst new file mode 100644 index 000000000..4ff4eb62b --- /dev/null +++ b/tests/roots/test-html_signaturereturn_icon/index.rst @@ -0,0 +1,4 @@ +test-html_signaturereturn_icon +============================== + +.. py:function:: foo(a: bool, b: int) -> str diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 2e53bdc54..e74319f19 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1635,3 +1635,11 @@ def test_html_permalink_icon(app): assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" ' 'href="#the-basic-sphinx-documentation-for-testing" ' 'title="Permalink to this headline"><span>[PERMALINK]</span></a></h1>' in content) + + +@pytest.mark.sphinx('html', testroot='html_signaturereturn_icon') +def test_html_signaturereturn_icon(app): + app.build() + content = (app.outdir / 'index.html').read_text() + + assert ('<span class="sig-return-icon">→</span>' in content) |
