What I'm aiming at is - if I ran the following test:
def test_func():
with pytest.raises(APIError):
func()
and the func() did not raise APIError - I want to get custom message to the output, e.g. "No APIError caught"
Pytest had a feature specifically for this:
with raises(SomeError, message="Custom message here"):
pass
https://docs.pytest.org/en/4.2.1/assert.html#assertions-about-expected-exceptions but for some reason it didn't make it to further versions (current is 6.0.2)