From aed9e17b6080d540ba5b5aab5e3096581a4bbd13 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 19 Jan 2014 12:09:27 -0600 Subject: revert fixture decorator for now, switch to append. no more globals --- tests/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/utils.py') diff --git a/tests/utils.py b/tests/utils.py index ee1675e8..a2432256 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -22,13 +22,13 @@ def select_backends(names, backend_list): split_names = [x.strip() for x in names.split(',')] # this must be duplicated and then removed to preserve the metadata # pytest associates. Appending backends to a new list doesn't seem to work - backends = list(backend_list) - for backend in backends: - if backend.name not in split_names: - backend_list.remove(backend) + selected_backends = [] + for backend in backend_list: + if backend.name in split_names: + selected_backends.append(backend) - if len(backend_list) > 0: - return backend_list + if len(selected_backends) > 0: + return selected_backends else: raise ValueError( "No backend selected. Tried to select: {0}".format(split_names) -- cgit v1.2.3