From 29462b1277fdae847b0527cf8e05a40c69810d39 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:24:13 -0700 Subject: [PATCH] type-ignore in error-message test --- testing/python/raises.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/python/raises.py b/testing/python/raises.py index b3fa0fc0e..f1f6ece4e 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -21,7 +21,9 @@ class TestRaises: def test_raises_does_not_allow_none(self): with pytest.raises(ValueError, match="Expected an exception type or"): - pytest.raises(expected_exception=None) + # We're testing that this invalid usage gives a helpful error, + # so we can ignore Mypy telling us that None is invalid. + pytest.raises(expected_exception=None) # type: ignore def test_raises_does_not_allow_empty_tuple(self): with pytest.raises(ValueError, match="Expected an exception type or"):