aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-07-02 00:21:41 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-07-02 00:21:41 -0400
commit50ebb489852b8c9dd02d08e09375aa00859999bf (patch)
treef40c381ff722229cd1763ca6ac313c3361a5009f /tests
parentcc04d679b81bcd69370ddc79c651e5e8a656ef04 (diff)
downloadcryptography-50ebb489852b8c9dd02d08e09375aa00859999bf.tar.gz
cryptography-50ebb489852b8c9dd02d08e09375aa00859999bf.tar.bz2
cryptography-50ebb489852b8c9dd02d08e09375aa00859999bf.zip
fixed tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils.py4
-rw-r--r--tests/utils.py12
2 files changed, 7 insertions, 9 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 8601d11d..f71264ea 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -85,7 +85,7 @@ def test_check_backend_support_skip():
supported = pretend.stub(
kwargs={"only_if": lambda backend: False, "skip_message": "Nope"}
)
- item = pretend.stub(keywords={"supported": supported},
+ item = pretend.stub(keywords={"supported": [supported]},
funcargs={"backend": True})
with pytest.raises(pytest.skip.Exception) as exc_info:
check_backend_support(item)
@@ -96,7 +96,7 @@ def test_check_backend_support_no_skip():
supported = pretend.stub(
kwargs={"only_if": lambda backend: True, "skip_message": "Nope"}
)
- item = pretend.stub(keywords={"supported": supported},
+ item = pretend.stub(keywords={"supported": [supported]},
funcargs={"backend": True})
assert check_backend_support(item) is None
diff --git a/tests/utils.py b/tests/utils.py
index c810303e..5083d48c 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -53,13 +53,11 @@ def skip_if_empty(backend_list, required_interfaces):
def check_backend_support(item):
supported = item.keywords.get("supported")
if supported and "backend" in item.funcargs:
- if not all(
- mark.kwargs["only_if"](item.funcargs["backend"])
- for mark in supported
- ):
- pytest.skip("{0} ({1})".format(
- supported.kwargs["skip_message"], item.funcargs["backend"]
- ))
+ for mark in supported:
+ if not mark.kwargs["only_if"](item.funcargs["backend"]):
+ pytest.skip("{0} ({1})".format(
+ mark.kwargs["skip_message"], item.funcargs["backend"]
+ ))
elif supported:
raise ValueError("This mark is only available on methods that take a "
"backend")