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
This commit is contained in:
Eric Dill 2015-07-11 11:20:29 -05:00
parent 934c2e437f
commit 5bfb903dac
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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__)