nixpkgs-suyu/pkgs/tools/networking/mitmproxy/pytest5.patch
2019-09-13 18:30:42 +02:00

31 lines
1.2 KiB
Diff

diff --git a/test/mitmproxy/net/test_tls.py b/test/mitmproxy/net/test_tls.py
index 489bf89f..c78472e3 100644
--- a/test/mitmproxy/net/test_tls.py
+++ b/test/mitmproxy/net/test_tls.py
@@ -87,14 +87,16 @@ def test_get_client_hello():
rfile = io.BufferedReader(io.BytesIO(
FULL_CLIENT_HELLO_NO_EXTENSIONS[:30]
))
- with pytest.raises(exceptions.TlsProtocolException, message="Unexpected EOF"):
+ with pytest.raises(exceptions.TlsProtocolException):
tls.get_client_hello(rfile)
+ pytest.fail("Unexpected EOF")
rfile = io.BufferedReader(io.BytesIO(
b"GET /"
))
- with pytest.raises(exceptions.TlsProtocolException, message="Expected TLS record"):
+ with pytest.raises(exceptions.TlsProtocolException):
tls.get_client_hello(rfile)
+ pytest.fail("Expected TLS record")
class TestClientHello:
@@ -153,5 +155,6 @@ class TestClientHello:
b"\x01\x00\x00\x03" + # handshake header
b"foo"
))
- with pytest.raises(exceptions.TlsProtocolException, message='Cannot parse Client Hello'):
+ with pytest.raises(exceptions.TlsProtocolException):
tls.ClientHello.from_file(rfile)
+ pytest.fail('Cannot parse Client Hello')