Fixes to @alex's comments
diff --git a/tests/test_utils.py b/tests/test_utils.py
index b430f56..939845f 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -1612,35 +1612,38 @@
assert cryptography.__version__ == cryptography_vectors.__version__
-@pytest.mark.xfail
def test_raises_unsupported_algorithm_wrong_type():
- # Check that it asserts if the wrong type of exception is raised.
- with raises_unsupported_algorithm(None):
- raise Exception
-
-
-@pytest.mark.xfail
-def test_raises_unsupported_algorithm_wrong_reason():
- # Check that it asserts if the wrong reason code is raised.
- with raises_unsupported_algorithm(None):
- raise UnsupportedAlgorithm("An error.",
- _Reasons.BACKEND_MISSING_INTERFACE)
-
-
-@pytest.mark.xfail
-def test_raises_unsupported_no_exc():
- # Check that it raises if no exception is raised.
- with raises_unsupported_algorithm(
- _Reasons.BACKEND_MISSING_INTERFACE
- ):
+ # Check that it raises if the wrong type of exception is raised.
+ class TestException(Exception):
pass
+ with pytest.raises(TestException):
+ with raises_unsupported_algorithm(None):
+ raise TestException
+
+
+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 raises_unsupported_algorithm(None):
+ raise UnsupportedAlgorithm("An error.",
+ _Reasons.BACKEND_MISSING_INTERFACE)
+
+
+def test_raises_unsupported_no_exc():
+ # Check that it fails if no exception is raised.
+ with pytest.raises(pytest.fail.Exception):
+ with raises_unsupported_algorithm(
+ _Reasons.BACKEND_MISSING_INTERFACE
+ ):
+ pass
+
def test_raises_unsupported_algorithm():
# Check that it doesnt assert if the right things are raised.
with raises_unsupported_algorithm(
_Reasons.BACKEND_MISSING_INTERFACE
- ) as exc:
+ ) as exc_info:
raise UnsupportedAlgorithm("An error.",
_Reasons.BACKEND_MISSING_INTERFACE)
- assert exc
+ assert exc_info.type is UnsupportedAlgorithm