aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-10-28 07:48:38 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-10-28 07:48:38 -0700
commit91d0ba1380c27e8a6b62be18e76536000d7006ea (patch)
treea4b22d30963e82636bb4703067d3b46c26add37c /tests/conftest.py
parent198bb65302f710957a5f67d53389277c5ab0a58c (diff)
parent4365b12f01b3f5f501ca4f86c59999e78980790c (diff)
downloadcryptography-91d0ba1380c27e8a6b62be18e76536000d7006ea.tar.gz
cryptography-91d0ba1380c27e8a6b62be18e76536000d7006ea.tar.bz2
cryptography-91d0ba1380c27e8a6b62be18e76536000d7006ea.zip
Merge branch 'master' into verify-interfaces
Conflicts: tests/hazmat/backends/test_commoncrypto.py tests/hazmat/backends/test_openssl.py tests/hazmat/primitives/test_block.py tests/hazmat/primitives/test_hashes.py tests/hazmat/primitives/test_hmac.py tests/hazmat/primitives/test_pbkdf2hmac.py
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 9dc37d38..27cf13b0 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -27,17 +27,12 @@ def pytest_generate_tests(metafunc):
if "backend" in metafunc.fixturenames:
filtered_backends = []
for backend in selected_backends:
- try:
- required = metafunc.function.requires_backend_interface
- except AttributeError:
- # function does not have requires_backend_interface decorator
+ required = metafunc.function.requires_backend_interface
+ required_interfaces = tuple(
+ mark.kwargs["interface"] for mark in required
+ )
+ if isinstance(backend, required_interfaces):
filtered_backends.append(backend)
- else:
- required_interfaces = tuple(
- mark.kwargs["interface"] for mark in required
- )
- if isinstance(backend, required_interfaces):
- filtered_backends.append(backend)
# 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