aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-13 21:52:08 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-13 21:52:08 -0500
commit34c075e6f331d146a617417e646170e8847c39e4 (patch)
tree5a44fdf1fcb41d082b1103753c832242081b7280 /tests/utils.py
parentf290f7d92d7608c6286b92ed235fdf4259627a5a (diff)
downloadcryptography-34c075e6f331d146a617417e646170e8847c39e4.tar.gz
cryptography-34c075e6f331d146a617417e646170e8847c39e4.tar.bz2
cryptography-34c075e6f331d146a617417e646170e8847c39e4.zip
support --backend as a pytest flag to limit to one backend for testing
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 693a0c8f..343f3efe 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -16,6 +16,16 @@ import os
import pytest
+def modify_backend_list(name, all_backends):
+ if name is not None:
+ backends = list(all_backends)
+ for backend in backends:
+ if backend.name != name:
+ all_backends.remove(backend)
+ if len(all_backends) == 0:
+ raise ValueError("No backends selected for testing")
+
+
def check_for_iface(name, iface, item):
if name in item.keywords and "backend" in item.funcargs:
if not isinstance(item.funcargs["backend"], iface):