diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-02-09 10:42:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-09 10:42:55 +0100 |
commit | 4cf6047a4eaf0d6f314ba5163ebda604c8836c9d (patch) | |
tree | 10447e8bf5d9ca3a53c03ed48a371662dfc52218 /test/pathod/test_pathoc.py | |
parent | 28c0596742674dd59df317a91389f3826b7d5e66 (diff) | |
parent | 7a9d40817ce0a97317b7940f7da2bb64da02eb51 (diff) | |
download | mitmproxy-4cf6047a4eaf0d6f314ba5163ebda604c8836c9d.tar.gz mitmproxy-4cf6047a4eaf0d6f314ba5163ebda604c8836c9d.tar.bz2 mitmproxy-4cf6047a4eaf0d6f314ba5163ebda604c8836c9d.zip |
Merge pull request #1999 from Kriechi/coverage++
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( |