aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/utils.py b/tests/utils.py
index bc5bc1ea..acc6c141 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -40,8 +40,6 @@ def select_backends(names, backend_list):
if names is None:
return 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
selected_backends = []
for backend in backend_list:
if backend.name in split_names:
@@ -55,6 +53,15 @@ def select_backends(names, backend_list):
)
+def skip_if_empty(backend_list, required_interfaces):
+ if not backend_list:
+ pytest.skip(
+ "No backends provided supply the interface: {0}".format(
+ ", ".join(iface.__name__ for iface in required_interfaces)
+ )
+ )
+
+
def check_backend_support(item):
supported = item.keywords.get("supported")
if supported and "backend" in item.funcargs: