mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix test: compile_latex_document()
This commit is contained in:
parent
b40ad9ffd4
commit
7b1755d21b
@ -23,7 +23,7 @@ from sphinx.config import Config
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.testing.util import strip_escseq
|
||||
from sphinx.util import docutils
|
||||
from sphinx.util.osutil import ensuredir
|
||||
from sphinx.util.osutil import cd, ensuredir
|
||||
from sphinx.writers.latex import LaTeXTranslator
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@ def kpsetest(*filenames):
|
||||
def compile_latex_document(app, filename='python.tex'):
|
||||
# now, try to run latex over it
|
||||
try:
|
||||
with cd(app.outdir):
|
||||
ensuredir(app.config.latex_engine)
|
||||
# keep a copy of latex file for this engine in case test fails
|
||||
copyfile(filename, app.config.latex_engine + '/' + filename)
|
||||
@ -62,7 +63,7 @@ def compile_latex_document(app, filename='python.tex'):
|
||||
'--interaction=nonstopmode',
|
||||
'-output-directory=%s' % app.config.latex_engine,
|
||||
filename]
|
||||
subprocess.run(args, stdout=PIPE, stderr=PIPE, cwd=app.outdir, check=True)
|
||||
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
||||
except OSError: # most likely the latex executable was not found
|
||||
raise pytest.skip.Exception
|
||||
except CalledProcessError as exc:
|
||||
|
Loading…
Reference in New Issue
Block a user