aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-10-25 12:22:10 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-10-25 12:22:10 -0700
commit902d8cfd58de395748d71f449944faa9dbac8725 (patch)
tree681d1b5a68a6e89efc8287685592b094f634ff9e /tests/utils.py
parent56f1a0ae53773285db53c367e697e0a015eed5f1 (diff)
downloadcryptography-902d8cfd58de395748d71f449944faa9dbac8725.tar.gz
cryptography-902d8cfd58de395748d71f449944faa9dbac8725.tar.bz2
cryptography-902d8cfd58de395748d71f449944faa9dbac8725.zip
move skip_if_empty to separate function for test coverage
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 7b462c2d..acc6c141 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -53,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: