aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-12-27 16:16:41 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-12-27 16:16:41 -0800
commit7ede6a4b80677bf56088b8492fa87b19183db448 (patch)
treea779758c943ba22310b8ba3bd7b3202446417503 /tests/utils.py
parent9b51cc1a843d6a8427eb4ad49aeaf5317c442fed (diff)
parentb078d8e1f446a1d2d13453e65e37fbaf4f6b17f2 (diff)
downloadcryptography-7ede6a4b80677bf56088b8492fa87b19183db448.tar.gz
cryptography-7ede6a4b80677bf56088b8492fa87b19183db448.tar.bz2
cryptography-7ede6a4b80677bf56088b8492fa87b19183db448.zip
Merge pull request #353 from reaperhulk/supported-mark
Add mark that allows us to do skip tests on backends via decorators
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 82021a5f..beb2ca5d 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -24,6 +24,16 @@ def check_for_iface(name, iface, item):
))
+def check_backend_support(item):
+ supported = item.keywords.get("supported")
+ if supported and "backend" in item.funcargs:
+ if not supported.kwargs["only_if"](item.funcargs["backend"]):
+ pytest.skip(supported.kwargs["skip_message"])
+ elif supported:
+ raise ValueError("This mark is only available on methods that take a "
+ "backend")
+
+
def load_vectors_from_file(filename, loader):
base = os.path.join(
os.path.dirname(__file__), "hazmat", "primitives", "vectors",