From 1a8de3b5047aca826ff3e338ae2160e395bf1872 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Oct 2017 11:04:32 +0200 Subject: [PATCH] Check for YAML C extensions on Travis See #2777 --- scripts/dev/ci/travis_run.sh | 2 +- tests/conftest.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/dev/ci/travis_run.sh b/scripts/dev/ci/travis_run.sh index 46a64bc9c..83f052f4c 100644 --- a/scripts/dev/ci/travis_run.sh +++ b/scripts/dev/ci/travis_run.sh @@ -1,7 +1,7 @@ #!/bin/bash if [[ $DOCKER ]]; then - docker run --privileged -v "$PWD:/outside" -e "QUTE_BDD_WEBENGINE=$QUTE_BDD_WEBENGINE" -e "DOCKER=$DOCKER" -e "CI=$CI" "qutebrowser/travis:$DOCKER" + docker run --privileged -v "$PWD:/outside" -e "QUTE_BDD_WEBENGINE=$QUTE_BDD_WEBENGINE" -e "DOCKER=$DOCKER" -e "CI=$CI" -e "TRAVIS=$TRAVIS" "qutebrowser/travis:$DOCKER" elif [[ $TESTENV == eslint ]]; then # Can't run this via tox as we can't easily install tox in the javascript travis env cd qutebrowser/javascript || exit 1 diff --git a/tests/conftest.py b/tests/conftest.py index 2ccf646dd..e1b5835fd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -224,6 +224,13 @@ def apply_fake_os(monkeypatch, request): monkeypatch.setattr('qutebrowser.utils.utils.is_posix', posix) +@pytest.fixture(scope='session', autouse=True) +def check_yaml_c_exts(): + """Make sure PyYAML C extensions are available on Travis.""" + if 'TRAVIS' in os.environ: + from yaml import CLoader + + @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_makereport(item, call): """Make test information available in fixtures.