aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-01-11 15:51:48 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-01-11 15:51:48 -0800
commitfa4700006ea1eb45387f2f4f0493ad07f78d1ad9 (patch)
tree733c10bc62a86cf6d7ccb1db2cb1a9bc975db9c2 /tests
parent1246a6e109ccba1c6c4fb84bbe3322ecd8868efb (diff)
parent0d58373aac5bdbd8f4b72a9bed02fc6a1e58b0b3 (diff)
downloadcryptography-fa4700006ea1eb45387f2f4f0493ad07f78d1ad9.tar.gz
cryptography-fa4700006ea1eb45387f2f4f0493ad07f78d1ad9.tar.bz2
cryptography-fa4700006ea1eb45387f2f4f0493ad07f78d1ad9.zip
Merge pull request #459 from public/use-pytest-fixture
Use pytest.fixture for backends
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py9
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