diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-01-10 22:39:12 +0000 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-01-11 23:31:24 +0000 |
commit | 0d58373aac5bdbd8f4b72a9bed02fc6a1e58b0b3 (patch) | |
tree | 0fa7c4021a123904ec58f84e7bf0273a2cadd0ce /tests | |
parent | d98b881521c4478ca31a90f9c101620ffe11cdbb (diff) | |
download | cryptography-0d58373aac5bdbd8f4b72a9bed02fc6a1e58b0b3.tar.gz cryptography-0d58373aac5bdbd8f4b72a9bed02fc6a1e58b0b3.tar.bz2 cryptography-0d58373aac5bdbd8f4b72a9bed02fc6a1e58b0b3.zip |
Use pytest.fixture for backends
This lets you chain in additional fixtures that vary by backend easily.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/conftest.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 0ddc3338..1d9f96ed 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,6 @@ import pytest +from cryptography.hazmat.backends import _ALL_BACKENDS from cryptography.hazmat.backends.interfaces import ( HMACBackend, CipherBackend, HashBackend ) @@ -7,11 +8,9 @@ from cryptography.hazmat.backends.interfaces import ( from .utils import check_for_iface, check_backend_support -def pytest_generate_tests(metafunc): - from cryptography.hazmat.backends import _ALL_BACKENDS - - if "backend" in metafunc.fixturenames: - metafunc.parametrize("backend", _ALL_BACKENDS) +@pytest.fixture(params=_ALL_BACKENDS) +def backend(request): + return request.param @pytest.mark.trylast |