mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fixed #1869: Fix problems when dealing with files containing non-ASCII characters.
This commit is contained in:
@@ -63,7 +63,7 @@ def test_code_block_caption_html(app, status, warning):
|
||||
@with_app('latex', testroot='directive-code')
|
||||
def test_code_block_caption_latex(app, status, warning):
|
||||
app.builder.build_all()
|
||||
latex = (app.outdir / 'Python.tex').text()
|
||||
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
|
||||
caption = '\\caption{caption \\emph{test} rb}'
|
||||
assert caption in latex
|
||||
|
||||
@@ -101,7 +101,7 @@ def test_literal_include_dedent(app, status, warning):
|
||||
@with_app('html', testroot='directive-code')
|
||||
def test_literal_include_linenos(app, status, warning):
|
||||
app.builder.build(['linenos'])
|
||||
html = (app.outdir / 'linenos.html').text()
|
||||
html = (app.outdir / 'linenos.html').text(encoding='utf-8')
|
||||
linenos = (
|
||||
'<td class="linenos"><div class="linenodiv"><pre>'
|
||||
' 1\n'
|
||||
@@ -124,7 +124,7 @@ def test_literal_include_linenos(app, status, warning):
|
||||
@with_app('html', testroot='directive-code')
|
||||
def test_literal_include_lineno_start(app, status, warning):
|
||||
app.builder.build(['lineno_start'])
|
||||
html = (app.outdir / 'lineno_start.html').text()
|
||||
html = (app.outdir / 'lineno_start.html').text(encoding='utf-8')
|
||||
linenos = (
|
||||
'<td class="linenos"><div class="linenodiv"><pre>'
|
||||
'200\n'
|
||||
@@ -147,7 +147,7 @@ def test_literal_include_lineno_start(app, status, warning):
|
||||
@with_app('html', testroot='directive-code')
|
||||
def test_literal_include_lineno_match(app, status, warning):
|
||||
app.builder.build(['lineno_match'])
|
||||
html = (app.outdir / 'lineno_match.html').text()
|
||||
html = (app.outdir / 'lineno_match.html').text(encoding='utf-8')
|
||||
pyobject = (
|
||||
'<td class="linenos"><div class="linenodiv"><pre>'
|
||||
' 9\n'
|
||||
@@ -180,7 +180,7 @@ def test_literal_include_lineno_match(app, status, warning):
|
||||
@with_app('latex', testroot='directive-code')
|
||||
def test_literalinclude_file_whole_of_emptyline(app, status, warning):
|
||||
app.builder.build_all()
|
||||
latex = (app.outdir / 'Python.tex').text()
|
||||
latex = (app.outdir / 'Python.tex').text(encoding='utf-8').replace('\r\n', '\n')
|
||||
includes = (
|
||||
'\\begin{Verbatim}[commandchars=\\\\\\{\\},numbers=left,firstnumber=1,stepnumber=1]\n'
|
||||
'\n'
|
||||
@@ -204,6 +204,6 @@ def test_literalinclude_caption_html(app, status, warning):
|
||||
@with_app('latex', testroot='directive-code')
|
||||
def test_literalinclude_caption_latex(app, status, warning):
|
||||
app.builder.build('index')
|
||||
latex = (app.outdir / 'Python.tex').text()
|
||||
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
|
||||
caption = '\\caption{caption \\textbf{test} py}'
|
||||
assert caption in latex
|
||||
|
||||
Reference in New Issue
Block a user