improve pytest.raises
This commit is contained in:
@@ -19,6 +19,10 @@ class TestRaises:
|
||||
excinfo = pytest.raises(ValueError, int, "hello")
|
||||
assert "invalid literal" in str(excinfo.value)
|
||||
|
||||
def test_raises_does_not_allow_empty_tuple(self):
|
||||
with pytest.raises(ValueError):
|
||||
pytest.raises(expected_exception=())
|
||||
|
||||
def test_raises_callable_no_exception(self) -> None:
|
||||
class A:
|
||||
def __call__(self):
|
||||
|
||||
Reference in New Issue
Block a user