From 5a8fdf82f396609ccb971d707edddea58f2d3917 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 26 Dec 2013 20:13:45 -0600 Subject: add mark that allows us to do skip tests on backends via decorators --- tests/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/utils.py') 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", -- cgit v1.2.3