diff options
| author | Martin Liska <mliska@suse.cz> | 2023-04-13 06:15:50 +0200 |
|---|---|---|
| committer | Martin Liska <mliska@suse.cz> | 2023-04-13 06:15:50 +0200 |
| commit | b6e6805f80ad530231cf841e689498005cf2bb96 (patch) | |
| tree | 895364caedf9218123bc96bb9ac15a329df4ed9b /tests | |
| parent | 188b869fa23d43be96b64e80987d12069743b9b5 (diff) | |
| download | sphinx-git-b6e6805f80ad530231cf841e689498005cf2bb96.tar.gz | |
test_build_latex: move output to a separate output dir
Related: #11285
Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_build_latex.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 8c6ecb96a..7fb59dbc9 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -27,7 +27,7 @@ except ImportError: from sphinx.util.osutil import _chdir as chdir LATEX_ENGINES = ['pdflatex', 'lualatex', 'xelatex'] -DOCCLASSES = ['howto', 'manual'] +DOCCLASSES = ['manual', 'howto'] STYLEFILES = ['article.cls', 'fancyhdr.sty', 'titlesec.sty', 'amsmath.sty', 'framed.sty', 'color.sty', 'fancyvrb.sty', 'fncychap.sty', 'geometry.sty', 'kvoptions.sty', 'hyperref.sty', @@ -51,17 +51,20 @@ def kpsetest(*filenames): # compile latex document with app.config.latex_engine -def compile_latex_document(app, filename='python.tex'): +def compile_latex_document(app, filename='python.tex', docclass='manual'): # now, try to run latex over it try: with chdir(app.outdir): - ensuredir(app.config.latex_engine) + # name latex output-directory according to both engine and docclass + # to avoid reuse of auxiliary files by one docclass from another + latex_outputdir = app.config.latex_engine + docclass + ensuredir(latex_outputdir) # keep a copy of latex file for this engine in case test fails - copyfile(filename, app.config.latex_engine + '/' + filename) + copyfile(filename, latex_outputdir + '/' + filename) args = [app.config.latex_engine, '--halt-on-error', '--interaction=nonstopmode', - '-output-directory=%s' % app.config.latex_engine, + '-output-directory=%s' % latex_outputdir, filename] subprocess.run(args, capture_output=True, check=True) except OSError as exc: # most likely the latex executable was not found @@ -117,7 +120,7 @@ def test_build_latex_doc(app, status, warning, engine, docclass): # file from latex_additional_files assert (app.outdir / 'svgimg.svg').isfile() - compile_latex_document(app, 'sphinxtests.tex') + compile_latex_document(app, 'sphinxtests.tex', docclass) @pytest.mark.sphinx('latex') |
