From 3cf1883356502499de7ba26ca3d4c11d3415fb91 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 22 Apr 2017 18:14:06 +0900 Subject: [PATCH] tests: compile by LaTeX only with py36 --- .travis.yml | 2 +- tests/test_build_latex.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3557095dd..fc3cac836 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,4 +51,4 @@ install: script: - flake8 - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then make style-check type-check test-async; fi - - if [[ $TRAVIS_PYTHON_VERSION != '3.6' ]]; then make test; fi + - if [[ $TRAVIS_PYTHON_VERSION != '3.6' ]]; then SKIP_LATEX_BUILD=1 make test; fi diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index c83b9c5f8..ad882758c 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -87,6 +87,14 @@ def compile_latex_document(app): app.config.latex_engine, p.returncode) +def skip_if_requested(testfunc): + if 'SKIP_LATEX_BUILD' in os.environ: + msg = 'Skip LaTeX builds because SKIP_LATEX_BUILD is set' + return skip_if(True, msg)(testfunc) + else: + return testfunc + + def skip_if_stylefiles_notfound(testfunc): if kpsetest(*STYLEFILES) is False: msg = 'not running latex, the required styles do not seem to be installed' @@ -95,6 +103,7 @@ def skip_if_stylefiles_notfound(testfunc): return testfunc +@skip_if_requested @skip_if_stylefiles_notfound @pytest.mark.parametrize( "engine,docclass",