From 4b15fa75d5218171019ab1f48121cf5435fe5bc5 Mon Sep 17 00:00:00 2001 From: Eric Dill Date: Sun, 2 Aug 2015 16:46:41 -0400 Subject: [PATCH] TST: Use pgcollections.OrderedDict for 2.6 compat --- .travis.yml | 5 +++++ examples/test_examples.py | 15 ++++++++++----- pyqtgraph/parametertree/SystemSolver.py | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3171f78d..f167791c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,6 +65,11 @@ install: - pip install pytest-xdist # multi-thread py.test - 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 - uname -a - cat /etc/issue diff --git a/examples/test_examples.py b/examples/test_examples.py index 0f9929ca..6fcee492 100644 --- a/examples/test_examples.py +++ b/examples/test_examples.py @@ -1,15 +1,20 @@ from __future__ import print_function, division, absolute_import from pyqtgraph import Qt -from examples import utils -import importlib +from . import utils import itertools 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) - 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 for frontend in frontends.keys(): try: diff --git a/pyqtgraph/parametertree/SystemSolver.py b/pyqtgraph/parametertree/SystemSolver.py index 0a889dfa..24e35e9a 100644 --- a/pyqtgraph/parametertree/SystemSolver.py +++ b/pyqtgraph/parametertree/SystemSolver.py @@ -1,4 +1,4 @@ -from collections import OrderedDict +from ..pgcollections import OrderedDict import numpy as np class SystemSolver(object):