aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-14 10:26:44 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-14 10:42:27 -0500
commit098579e27f380ce95f620b34984f20342db2395f (patch)
tree139b2a2176dd25afd8117c3b75601bfd1dd95cb5 /tests/conftest.py
parentc1fd2be467947c455aef7687a7ecaa4de1f300b1 (diff)
downloadcryptography-098579e27f380ce95f620b34984f20342db2395f.tar.gz
cryptography-098579e27f380ce95f620b34984f20342db2395f.tar.bz2
cryptography-098579e27f380ce95f620b34984f20342db2395f.zip
don't mutate _ALL_BACKENDS
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 5cc30428..86debe7c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -8,12 +8,19 @@ from cryptography.hazmat.backends.interfaces import (
from .utils import check_for_iface, check_backend_support, modify_backend_list
+# 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
+
+_UPDATED_BACKENDS = list(_ALL_BACKENDS)
+
+
def pytest_generate_tests(metafunc):
+ global _UPDATED_BACKENDS
name = metafunc.config.getoption("--backend")
- modify_backend_list(name, _ALL_BACKENDS)
+ modify_backend_list(name, _UPDATED_BACKENDS)
-@pytest.fixture(params=_ALL_BACKENDS)
+@pytest.fixture(params=_UPDATED_BACKENDS)
def backend(request):
return request.param