Skip to content

Commit

Permalink
python 2.7 doesn't support dict unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeff committed Feb 15, 2019
1 parent 720646e commit 172d83f
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions pygsp/tests/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,19 +358,26 @@ def test_nngraph(self, n_vertices=30):
for backend in backends:
for metric in metrics:
for kind in ['knn', 'radius']:
params = dict(features=features, metric=metric,
order=order, kind=kind, backend=backend)
# Unsupported combinations.
if backend == 'flann' and metric == 'max_dist':
self.assertRaises(ValueError, graphs.NNGraph, **params)
self.assertRaises(ValueError, graphs.NNGraph, features,
metric=metric, backend=backend)
elif backend == 'nmslib' and metric == 'minkowski':
self.assertRaises(ValueError, graphs.NNGraph, **params)
self.assertRaises(ValueError, graphs.NNGraph, features,
metric=metric, backend=backend)
elif backend == 'nmslib' and kind == 'radius':
self.assertRaises(ValueError, graphs.NNGraph, **params)
self.assertRaises(ValueError, graphs.NNGraph, features,
kind=kind, backend=backend)
else:
graphs.NNGraph(**params, center=False)
graphs.NNGraph(**params, rescale=False)
graphs.NNGraph(**params, center=False, rescale=False)
graphs.NNGraph(features, metric=metric, order=order,
kind=kind, backend=backend,
center=False)
graphs.NNGraph(features, metric=metric, order=order,
kind=kind, backend=backend,
rescale=False)
graphs.NNGraph(features, metric=metric, order=order,
kind=kind, backend=backend,
center=False, rescale=False)

# Invalid parameters.
self.assertRaises(ValueError, graphs.NNGraph, features,
Expand Down

0 comments on commit 172d83f

Please sign in to comment.