commit
9e8c2082ed
27
.travis.yml
27
.travis.yml
|
@ -17,7 +17,7 @@ env:
|
||||||
# Enable python 2 and python 3 builds
|
# Enable python 2 and python 3 builds
|
||||||
# Note that the 2.6 build doesn't get flake8, and runs old versions of
|
# Note that the 2.6 build doesn't get flake8, and runs old versions of
|
||||||
# Pyglet and GLFW to make sure we deal with those correctly
|
# Pyglet and GLFW to make sure we deal with those correctly
|
||||||
#- PYTHON=2.6 QT=pyqt TEST=standard
|
- PYTHON=2.6 QT=pyqt TEST=standard
|
||||||
- PYTHON=2.7 QT=pyqt TEST=extra
|
- PYTHON=2.7 QT=pyqt TEST=extra
|
||||||
- PYTHON=2.7 QT=pyside TEST=standard
|
- PYTHON=2.7 QT=pyside TEST=standard
|
||||||
- PYTHON=3.4 QT=pyqt TEST=standard
|
- PYTHON=3.4 QT=pyqt TEST=standard
|
||||||
|
@ -30,7 +30,7 @@ before_install:
|
||||||
- chmod +x miniconda.sh
|
- chmod +x miniconda.sh
|
||||||
- ./miniconda.sh -b -p /home/travis/mc
|
- ./miniconda.sh -b -p /home/travis/mc
|
||||||
- export PATH=/home/travis/mc/bin:$PATH
|
- export PATH=/home/travis/mc/bin:$PATH
|
||||||
|
|
||||||
# not sure what is if block is for
|
# not sure what is if block is for
|
||||||
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
|
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
|
||||||
GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
|
GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
|
||||||
|
@ -55,7 +55,7 @@ install:
|
||||||
- echo ${QT}
|
- echo ${QT}
|
||||||
- echo ${TEST}
|
- echo ${TEST}
|
||||||
- echo ${PYTHON}
|
- echo ${PYTHON}
|
||||||
|
|
||||||
- if [ "${QT}" == "pyqt" ]; then
|
- if [ "${QT}" == "pyqt" ]; then
|
||||||
conda install pyqt --yes;
|
conda install pyqt --yes;
|
||||||
fi;
|
fi;
|
||||||
|
@ -64,7 +64,12 @@ install:
|
||||||
fi;
|
fi;
|
||||||
- pip install pytest-xdist # multi-thread py.test
|
- pip install pytest-xdist # multi-thread py.test
|
||||||
- pip install pytest-cov # add coverage stats
|
- pip install pytest-cov # add coverage stats
|
||||||
|
|
||||||
|
# required for example testing on python 2.6
|
||||||
|
- if [ "${PYTHON}" == "2.6" ]; then
|
||||||
|
pip install importlib;
|
||||||
|
fi;
|
||||||
|
|
||||||
# Debugging helpers
|
# Debugging helpers
|
||||||
- uname -a
|
- uname -a
|
||||||
- cat /etc/issue
|
- cat /etc/issue
|
||||||
|
@ -79,7 +84,7 @@ before_script:
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
- "sh -e /etc/init.d/xvfb start"
|
||||||
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
|
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
|
||||||
|
|
||||||
# Make sure everyone uses the correct python (this is handled by conda)
|
# Make sure everyone uses the correct python (this is handled by conda)
|
||||||
- which python
|
- which python
|
||||||
- python --version
|
- python --version
|
||||||
|
@ -127,16 +132,16 @@ before_script:
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|
||||||
- source activate test_env
|
- source activate test_env
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
- start_test "unit tests";
|
- start_test "unit tests";
|
||||||
PYTHONPATH=. py.test --cov pyqtgraph -n 4 -sv;
|
PYTHONPATH=. py.test --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
|
||||||
|
|
||||||
# check line endings
|
# check line endings
|
||||||
- if [ "${TEST}" == "extra" ]; then
|
- if [ "${TEST}" == "extra" ]; then
|
||||||
start_test "line ending check";
|
start_test "line ending check";
|
||||||
|
@ -166,13 +171,13 @@ script:
|
||||||
- start_test "install test";
|
- start_test "install test";
|
||||||
python setup.py --quiet install;
|
python setup.py --quiet install;
|
||||||
check_output "install test";
|
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";
|
||||||
bash -c "! python setup.py --quiet install";
|
bash -c "! python setup.py --quiet install";
|
||||||
check_output "double install test";
|
check_output "double install test";
|
||||||
|
|
||||||
# Check we can import pg
|
# Check we can import pg
|
||||||
- start_test "import test";
|
- start_test "import test";
|
||||||
echo "import sys; print(sys.path)" | python &&
|
echo "import sys; print(sys.path)" | python &&
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
from __future__ import print_function, division, absolute_import
|
from __future__ import print_function, division, absolute_import
|
||||||
from pyqtgraph import Qt
|
from pyqtgraph import Qt
|
||||||
from examples import utils
|
from . import utils
|
||||||
import importlib
|
|
||||||
import itertools
|
import itertools
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
# apparently importlib does not exist in python 2.6...
|
||||||
|
try:
|
||||||
|
import importlib
|
||||||
|
except ImportError:
|
||||||
|
# we are on python 2.6
|
||||||
|
print("If you want to test the examples, please install importlib from "
|
||||||
|
"pypi\n\npip install importlib\n\n")
|
||||||
|
pass
|
||||||
|
|
||||||
files = utils.buildFileList(utils.examples)
|
files = utils.buildFileList(utils.examples)
|
||||||
|
|
||||||
frontends = {Qt.PYQT4: False, Qt.PYSIDE: False}
|
frontends = {Qt.PYQT4: False, Qt.PYSIDE: False}
|
||||||
# frontends = {Qt.PYQT4: False, Qt.PYQT5: False, Qt.PYSIDE: False}
|
|
||||||
|
|
||||||
# sort out which of the front ends are available
|
# sort out which of the front ends are available
|
||||||
for frontend in frontends.keys():
|
for frontend in frontends.keys():
|
||||||
try:
|
try:
|
||||||
|
@ -25,7 +30,7 @@ def test_examples(frontend, f):
|
||||||
# Test the examples with all available front-ends
|
# Test the examples with all available front-ends
|
||||||
print('frontend = %s. f = %s' % (frontend, f))
|
print('frontend = %s. f = %s' % (frontend, f))
|
||||||
if not frontends[frontend]:
|
if not frontends[frontend]:
|
||||||
pytest.skip('{} is not installed. Skipping tests'.format(frontend))
|
pytest.skip('%s is not installed. Skipping tests' % frontend)
|
||||||
utils.testFile(f[0], f[1], utils.sys.executable, frontend)
|
utils.testFile(f[0], f[1], utils.sys.executable, frontend)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from collections import OrderedDict
|
from ..pgcollections import OrderedDict
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
class SystemSolver(object):
|
class SystemSolver(object):
|
||||||
|
|
|
@ -34,7 +34,7 @@ itemTypes = [
|
||||||
|
|
||||||
widgets = []
|
widgets = []
|
||||||
items = []
|
items = []
|
||||||
allWidgets = weakref.WeakSet()
|
allWidgets = weakref.WeakKeyDictionary()
|
||||||
|
|
||||||
|
|
||||||
def crashtest():
|
def crashtest():
|
||||||
|
@ -99,7 +99,7 @@ def createWidget():
|
||||||
widget = randItem(widgetTypes)()
|
widget = randItem(widgetTypes)()
|
||||||
widget.setWindowTitle(widget.__class__.__name__)
|
widget.setWindowTitle(widget.__class__.__name__)
|
||||||
widgets.append(widget)
|
widgets.append(widget)
|
||||||
allWidgets.add(widget)
|
allWidgets[widget] = 1
|
||||||
p(" %s" % widget)
|
p(" %s" % widget)
|
||||||
return widget
|
return widget
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user