aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py12
1 files changed, 6 insertions, 6 deletions
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)