summaryrefslogtreecommitdiff
path: root/tests/test_directive_code.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-09-17 18:13:17 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-09-17 18:13:17 +0900
commitcfddf17d350ea16e2dbea23f926ef2fc0b5e8372 (patch)
tree3a89107e7211074005321e70fb6a249b75cb0793 /tests/test_directive_code.py
parent98886d3e07f528364661f87b988f12d5150eb4f2 (diff)
downloadsphinx-git-cfddf17d350ea16e2dbea23f926ef2fc0b5e8372.tar.gz
Fix #2931: code-block directive with same :caption: causes warning of duplicate target
Diffstat (limited to 'tests/test_directive_code.py')
-rw-r--r--tests/test_directive_code.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py
index 175e1881e..6751c0592 100644
--- a/tests/test_directive_code.py
+++ b/tests/test_directive_code.py
@@ -56,7 +56,7 @@ def test_code_block_caption_html(app, status, warning):
caption = (u'<div class="code-block-caption">'
u'<span class="caption-number">Listing 1 </span>'
u'<span class="caption-text">caption <em>test</em> rb'
- u'</span><a class="headerlink" href="#caption-test-rb" '
+ u'</span><a class="headerlink" href="#id1" '
u'title="Permalink to this code">\xb6</a></div>')
assert caption in html
@@ -66,9 +66,9 @@ def test_code_block_caption_latex(app, status, warning):
app.builder.build_all()
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
caption = '\\sphinxSetupCaptionForVerbatim{caption \\sphinxstyleemphasis{test} rb}'
- label = '\\def\\sphinxLiteralBlockLabel{\\label{caption:caption-test-rb}}'
- link = '\hyperref[caption:caption-test-rb]' \
- '{Listing \\ref{caption:caption-test-rb}}'
+ label = '\\def\\sphinxLiteralBlockLabel{\\label{caption:id1}}'
+ link = '\hyperref[caption:name-test-rb]' \
+ '{Listing \\ref{caption:name-test-rb}}'
assert caption in latex
assert label in latex
assert link in latex
@@ -244,7 +244,7 @@ def test_literalinclude_caption_html(app, status, warning):
caption = (u'<div class="code-block-caption">'
u'<span class="caption-number">Listing 2 </span>'
u'<span class="caption-text">caption <strong>test</strong> py'
- u'</span><a class="headerlink" href="#caption-test-py" '
+ u'</span><a class="headerlink" href="#id2" '
u'title="Permalink to this code">\xb6</a></div>')
assert caption in html
@@ -254,9 +254,9 @@ def test_literalinclude_caption_latex(app, status, warning):
app.builder.build('index')
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
caption = '\\sphinxSetupCaptionForVerbatim{caption \\sphinxstylestrong{test} py}'
- label = '\\def\\sphinxLiteralBlockLabel{\\label{caption:caption-test-py}}'
- link = '\hyperref[caption:caption-test-py]' \
- '{Listing \\ref{caption:caption-test-py}}'
+ label = '\\def\\sphinxLiteralBlockLabel{\\label{caption:id2}}'
+ link = '\hyperref[caption:name-test-py]' \
+ '{Listing \\ref{caption:name-test-py}}'
assert caption in latex
assert label in latex
assert link in latex