Fix pg.exit test in case pyqtgraph is not installed

This commit is contained in:
Kenneth Lyons 2019-06-24 16:17:48 -07:00 committed by Ogi
parent 650b551b7a
commit 26963ffbc4
2 changed files with 9 additions and 8 deletions

View File

@ -61,7 +61,7 @@ install:
- if [ "${QT}" == "pyside" ]; then - if [ "${QT}" == "pyside" ]; then
conda install pyside --yes; conda install pyside --yes;
fi; fi;
- pip install pytest-xdist # multi-thread py.test - pip install pytest-xdist # multi-thread pytest
- pip install pytest-cov # add coverage stats - pip install pytest-cov # add coverage stats
- pip install pytest-faulthandler # activate faulthandler - pip install pytest-faulthandler # activate faulthandler
@ -132,9 +132,15 @@ script:
# Check system info # Check system info
- python -c "import pyqtgraph as pg; pg.systemInfo()" - python -c "import pyqtgraph as pg; pg.systemInfo()"
# Check install works
- start_test "install test";
python setup.py --quiet install;
check_output "install test";
# Run unit tests # Run unit tests
- start_test "unit tests"; - start_test "unit tests";
PYTHONPATH=. py.test --cov pyqtgraph -sv; PYTHONPATH=. pytest --cov pyqtgraph -sv;
check_output "unit tests"; check_output "unit tests";
- echo "test script finished. Current directory:" - echo "test script finished. Current directory:"
- pwd - pwd
@ -164,11 +170,6 @@ script:
check_output "style check"; check_output "style check";
fi; fi;
# Check install works
- start_test "install test";
python setup.py --quiet install;
check_output "install test";
# Check double-install fails # Check double-install fails
# Note the bash -c is because travis strips off the ! otherwise. # Note the bash -c is because travis strips off the ! otherwise.
- start_test "double install test"; - start_test "double install test";

View File

@ -74,5 +74,5 @@ def test_pg_exit():
pg.plot() pg.plot()
pg.exit() pg.exit()
""") """)
rc = call_with_timeout([sys.executable, '-c', code], timeout=5) rc = call_with_timeout([sys.executable, '-c', code], timeout=5, shell=False)
assert rc == 0 assert rc == 0