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
[deprecating](https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises)
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'"):
basic_reader.feed(47)
def test_protocol_error(basic_reader):
basic_reader.feed(b'x')
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"):
basic_reader.gets()
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