aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-12-26 20:13:45 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-12-26 20:13:45 -0600
commit5a8fdf82f396609ccb971d707edddea58f2d3917 (patch)
tree47e7815de4ba685237653de9efe31cad4b8daf27 /tests/utils.py
parentb645521e84026633f666aa107816ac2fc5e05cc6 (diff)
downloadcryptography-5a8fdf82f396609ccb971d707edddea58f2d3917.tar.gz
cryptography-5a8fdf82f396609ccb971d707edddea58f2d3917.tar.bz2
cryptography-5a8fdf82f396609ccb971d707edddea58f2d3917.zip
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..113488d3 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -24,6 +24,16 @@ def check_for_iface(name, iface, item):
))
+def supported_by_backend_skip(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 TypeError("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",