aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/test_utils.py2
-rw-r--r--tests/utils.py3
2 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 939845fc..d0b70663 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -1624,7 +1624,7 @@ def test_raises_unsupported_algorithm_wrong_type():
def test_raises_unsupported_algorithm_wrong_reason():
# Check that it fails if the wrong reason code is raised.
- with pytest.raises(pytest.fail.Exception):
+ with pytest.raises(AssertionError):
with raises_unsupported_algorithm(None):
raise UnsupportedAlgorithm("An error.",
_Reasons.BACKEND_MISSING_INTERFACE)
diff --git a/tests/utils.py b/tests/utils.py
index 3e5ea5f3..bdbf996f 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -74,8 +74,7 @@ def raises_unsupported_algorithm(reason):
with pytest.raises(UnsupportedAlgorithm) as exc_info:
yield exc_info
- if exc_info.value._reason is not reason:
- pytest.fail("Did not get expected reason tag for UnsupportedAlgorithm")
+ assert exc_info.value._reason is reason
def load_vectors_from_file(filename, loader):