aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.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/conftest.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/conftest.py')
-rw-r--r--tests/conftest.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 1cb2b30d..9dc37d38 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -17,7 +17,7 @@ import pytest
from cryptography.hazmat.backends import _available_backends
-from .utils import check_backend_support, select_backends
+from .utils import check_backend_support, select_backends, skip_if_empty
def pytest_generate_tests(metafunc):
@@ -39,16 +39,11 @@ def pytest_generate_tests(metafunc):
if isinstance(backend, required_interfaces):
filtered_backends.append(backend)
- if not filtered_backends:
- # If you pass an empty list to parametrize Bad Things(tm) happen
- # as of pytest 2.6.4 when the test also has a parametrize decorator
- pytest.skip(
- "No backends provided supply the interface: {0}".format(
- ", ".join(iface.__name__ for iface in required_interfaces)
- )
- )
- else:
- metafunc.parametrize("backend", filtered_backends)
+ # If you pass an empty list to parametrize Bad Things(tm) happen
+ # as of pytest 2.6.4 when the test also has a parametrize decorator
+ skip_if_empty(filtered_backends, required_interfaces)
+
+ metafunc.parametrize("backend", filtered_backends)
@pytest.mark.trylast