diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-02-06 17:48:44 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-02-08 20:04:07 +0100 |
commit | 7a9d40817ce0a97317b7940f7da2bb64da02eb51 (patch) | |
tree | 10447e8bf5d9ca3a53c03ed48a371662dfc52218 /test/pathod/test_pathoc.py | |
parent | 28c0596742674dd59df317a91389f3826b7d5e66 (diff) | |
download | mitmproxy-7a9d40817ce0a97317b7940f7da2bb64da02eb51.tar.gz mitmproxy-7a9d40817ce0a97317b7940f7da2bb64da02eb51.tar.bz2 mitmproxy-7a9d40817ce0a97317b7940f7da2bb64da02eb51.zip |
pytest.raises: shim new API
Diffstat (limited to 'test/pathod/test_pathoc.py')
-rw-r--r-- | test/pathod/test_pathoc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index a8f79e67..2dd29e20 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -173,12 +173,12 @@ class TestDaemon(PathocTestDaemon): to = ("foobar", 80) c = pathoc.Pathoc(("127.0.0.1", self.d.port), fp=None) c.rfile, c.wfile = io.BytesIO(), io.BytesIO() - with pytest.raises("connect failed"): + with pytest.raises(Exception, match="CONNECT failed"): c.http_connect(to) c.rfile = io.BytesIO( b"HTTP/1.1 500 OK\r\n" ) - with pytest.raises("connect failed"): + with pytest.raises(Exception, match="CONNECT failed"): c.http_connect(to) c.rfile = io.BytesIO( b"HTTP/1.1 200 OK\r\n" @@ -195,14 +195,14 @@ class TestDaemon(PathocTestDaemon): c.rfile = tutils.treader( b"\x05\xEE" ) - with pytest.raises("SOCKS without authentication"): + with pytest.raises(Exception, match="SOCKS without authentication"): c.socks_connect(("example.com", 0xDEAD)) c.rfile = tutils.treader( b"\x05\x00" + b"\x05\xEE\x00\x03\x0bexample.com\xDE\xAD" ) - with pytest.raises("SOCKS server error"): + with pytest.raises(Exception, match="SOCKS server error"): c.socks_connect(("example.com", 0xDEAD)) c.rfile = tutils.treader( |