From e166a3ef2e3f9e0d99824323ff4306dfeb4c042f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Defferrard?= Date: Fri, 15 Feb 2019 11:13:22 +0100 Subject: [PATCH] python 2.7 doesn't support dict unpacking --- pygsp/tests/test_graphs.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pygsp/tests/test_graphs.py b/pygsp/tests/test_graphs.py index 15359699..66e010f5 100644 --- a/pygsp/tests/test_graphs.py +++ b/pygsp/tests/test_graphs.py @@ -501,19 +501,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,