mitmproxy: add pytest5 compatability
This commit is contained in:
31
pkgs/tools/networking/mitmproxy/pytest5.patch
Normal file
31
pkgs/tools/networking/mitmproxy/pytest5.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
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')
|
||||
Reference in New Issue
Block a user