diff options
Diffstat (limited to 'tests/test_build_html.py')
-rw-r--r-- | tests/test_build_html.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py index a1e1018a6..91ba1ca46 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1710,3 +1710,27 @@ def test_html_signaturereturn_icon(app): content = (app.outdir / 'index.html').read_text() assert ('<span class="sig-return-icon">→</span>' in content) + + +@pytest.mark.sphinx('html', testroot='reST-code-role') +def test_html_code_role(app): + app.build() + content = (app.outdir / 'index.html').read_text() + + common_content = ( + '<span class="k">def</span> <span class="nf">foo</span>' + '<span class="p">(</span>' + '<span class="mi">1</span> ' + '<span class="o">+</span> ' + '<span class="mi">2</span> ' + '<span class="o">+</span> ' + '<span class="kc">None</span> ' + '<span class="o">+</span> ' + '<span class="s2">"abc"</span>' + '<span class="p">):</span> ' + '<span class="k">pass</span>') + assert ('<p>Inline <code class="code highlight python docutils literal highlight-python">' + + common_content + '</code> code block</p>') in content + assert ('<div class="highlight-python notranslate">' + + '<div class="highlight"><pre><span></span>' + + common_content) in content |