type-ignore in error-message test

This commit is contained in:
Zac Hatfield-Dodds 2022-05-10 23:24:13 -07:00
parent 31a9c5c667
commit 29462b1277
1 changed files with 3 additions and 1 deletions

View File

@ -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"):