From df0467961e2141f91bdead670a53cce1a398bde4 Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Sun, 30 Jun 2019 13:30:58 -0700 Subject: [PATCH] Install pytest-faulthandler for py27 and add timeout --- .travis.yml | 7 ++++++- azure-test-template.yml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c75f4523..642181f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,11 @@ install: - pip install pytest-xdist # multi-thread pytest - pip install pytest-cov # add coverage stats + # faulthandler support not built in to pytest for python 2.7 + - if [ "${PYTHON}" == "2.7" ]; then + pip install pytest-faulthandler; + fi; + # Debugging helpers - uname -a - cat /etc/issue @@ -139,7 +144,7 @@ script: # Run unit tests - start_test "unit tests"; - PYTHONPATH=. pytest --cov pyqtgraph -sv; + PYTHONPATH=. pytest --cov pyqtgraph -sv -o faulthandler_timeout=15; check_output "unit tests"; - echo "test script finished. Current directory:" - pwd diff --git a/azure-test-template.yml b/azure-test-template.yml index d66c304c..38b7d8b2 100644 --- a/azure-test-template.yml +++ b/azure-test-template.yml @@ -99,6 +99,10 @@ jobs: pip install $(qt.bindings) numpy scipy pyopengl pytest six coverage fi pip install pytest-xdist pytest-cov + if [ $(python.version) == "2.7" ] + then + pip install pytest-faulthandler + fi displayName: "Install Dependencies" - bash: | @@ -170,7 +174,8 @@ jobs: # echo "https://dev.azure.com/pyqtgraph/pyqtgraph/_apis/build/builds/$(Build.BuildId)/artifacts?artifactName=Screenshots&api-version=5.0" pytest . -sv \ --junitxml=junit/test-results.xml \ - -n 1 --cov pyqtgraph --cov-report=xml --cov-report=html + -n 1 --cov pyqtgraph --cov-report=xml --cov-report=html \ + -o faulthandler_timeout=15 displayName: 'Unit tests' env: AZURE: 1