diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-19 12:09:27 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-19 12:09:27 -0600 |
commit | aed9e17b6080d540ba5b5aab5e3096581a4bbd13 (patch) | |
tree | f82b79122e6840d48417edf37efd26df51077588 /tests/conftest.py | |
parent | 2502ce599b39509ba9c05b6e553527e5ed5ac43c (diff) | |
download | cryptography-aed9e17b6080d540ba5b5aab5e3096581a4bbd13.tar.gz cryptography-aed9e17b6080d540ba5b5aab5e3096581a4bbd13.tar.bz2 cryptography-aed9e17b6080d540ba5b5aab5e3096581a4bbd13.zip |
revert fixture decorator for now, switch to append. no more globals
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index b9879f86..a9acb54a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,20 +8,12 @@ from cryptography.hazmat.backends.interfaces import ( from .utils import check_for_iface, check_backend_support, select_backends -# copy all backends so we can mutate it.This variable is used in generate -# tests to allow us to target a single backend without changing _ALL_BACKENDS -_SELECTED_BACKENDS = list(_ALL_BACKENDS) - - def pytest_generate_tests(metafunc): - global _SELECTED_BACKENDS names = metafunc.config.getoption("--backend") - _SELECTED_BACKENDS = select_backends(names, _SELECTED_BACKENDS) - + selected_backends = select_backends(names, _ALL_BACKENDS) -@pytest.fixture(params=_SELECTED_BACKENDS) -def backend(request): - return request.param + if "backend" in metafunc.fixturenames: + metafunc.parametrize("backend", selected_backends) @pytest.mark.trylast |