Commit a5bc15e7 authored by Tim Stumbaugh's avatar Tim Stumbaugh

Fix usage of `pytest.raises`

This was intended to check the message in the exception, not be a
custom message. py.test is
this because it is a common mistake
parent 6eb5ec35
Pipeline #75778464 passed with stage
in 3 minutes and 44 seconds
......@@ -19,12 +19,12 @@ def test_nothing(basic_reader):
assert basic_reader.gets() is False
def test_error_when_feeding_non_string(basic_reader):
with pytest.raises(TypeError, message="a bytes-like object is required, not 'int'"):
with pytest.raises(TypeError, match="a bytes-like object is required, not 'int'"):
def test_protocol_error(basic_reader):
with pytest.raises(ProtocolError, message="Can't decode prefix b'x'! Possible desync"):
with pytest.raises(ProtocolError, match="Can't decode prefix b'x'! Possible desync"):
def test_protocol_error_with_custom_class():
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment