summaryrefslogtreecommitdiff
path: root/tests/test_build_latex.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_build_latex.py')
-rw-r--r--tests/test_build_latex.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
index b0ae85423..fa7847d44 100644
--- a/tests/test_build_latex.py
+++ b/tests/test_build_latex.py
@@ -1628,3 +1628,30 @@ def test_latex_container(app, status, warning):
result = (app.outdir / 'python.tex').read_text()
assert r'\begin{sphinxuseclass}{classname}' in result
assert r'\end{sphinxuseclass}' in result
+
+
+@pytest.mark.sphinx('latex', testroot='reST-code-role')
+def test_latex_code_role(app):
+ app.build()
+ content = (app.outdir / 'python.tex').read_text()
+
+ common_content = (
+ r'\PYG{k}{def} '
+ r'\PYG{n+nf}{foo}'
+ r'\PYG{p}{(}'
+ r'\PYG{l+m+mi}{1} '
+ r'\PYG{o}{+} '
+ r'\PYG{l+m+mi}{2} '
+ r'\PYG{o}{+} '
+ r'\PYG{k+kc}{None} '
+ r'\PYG{o}{+} '
+ r'\PYG{l+s+s2}{\PYGZdq{}}'
+ r'\PYG{l+s+s2}{abc}'
+ r'\PYG{l+s+s2}{\PYGZdq{}}'
+ r'\PYG{p}{)}'
+ r'\PYG{p}{:} '
+ r'\PYG{k}{pass}')
+ assert (r'Inline \sphinxcode{\sphinxupquote{' + '\n' +
+ common_content + '\n}} code block') in content
+ assert (r'\begin{sphinxVerbatim}[commandchars=\\\{\}]' +
+ '\n' + common_content + '\n' + r'\end{sphinxVerbatim}') in content