From 5bfb903dac4b562e1708dec216909dbe3d68a8dc Mon Sep 17 00:00:00 2001 From: Eric Dill Date: Sat, 11 Jul 2015 11:20:29 -0500 Subject: [PATCH] TST: python 3 generator compat .keys() in python2 returns a list, .keys() in python3 returns a generator. Wrap .keys() in a list so that you can index on it in python3 --- pyqtgraph/parametertree/tests/test_parametertypes.py | 4 ++-- pyqtgraph/tests/test_exit_crash.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyqtgraph/parametertree/tests/test_parametertypes.py b/pyqtgraph/parametertree/tests/test_parametertypes.py index c7cd2cb3..dc581019 100644 --- a/pyqtgraph/parametertree/tests/test_parametertypes.py +++ b/pyqtgraph/parametertree/tests/test_parametertypes.py @@ -12,7 +12,7 @@ def test_opts(): tree = pt.ParameterTree() tree.setParameters(param) - assert param.param('bool').items.keys()[0].widget.isEnabled() is False - assert param.param('color').items.keys()[0].widget.isEnabled() is False + assert list(param.param('bool').items.keys())[0].widget.isEnabled() is False + assert list(param.param('color').items.keys())[0].widget.isEnabled() is False diff --git a/pyqtgraph/tests/test_exit_crash.py b/pyqtgraph/tests/test_exit_crash.py index f3ce8282..dfad5228 100644 --- a/pyqtgraph/tests/test_exit_crash.py +++ b/pyqtgraph/tests/test_exit_crash.py @@ -12,8 +12,8 @@ w = pg.{classname}({args}) def test_exit_crash(): - # For each Widget subclass, run a simple python script that creates an - # instance and then shuts down. The intent is to check for segmentation + # For each Widget subclass, run a simple python script that creates an + # instance and then shuts down. The intent is to check for segmentation # faults when each script exits. tmp = tempfile.mktemp(".py") path = os.path.dirname(pg.__file__)