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_language_http.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_language_http.py')
-rw-r--r-- | test/pathod/test_language_http.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/pathod/test_language_http.py b/test/pathod/test_language_http.py index 199fdf64..6ab43fe0 100644 --- a/test/pathod/test_language_http.py +++ b/test/pathod/test_language_http.py @@ -20,7 +20,7 @@ def test_make_error_response(): class TestRequest: def test_nonascii(self): - with pytest.raises("ascii"): + with pytest.raises(Exception, match="ASCII"): parse_request("get:\xf0") def test_err(self): @@ -226,7 +226,7 @@ class TestResponse: assert str(v) def test_nonascii(self): - with pytest.raises("ascii"): + with pytest.raises(Exception, match="ASCII"): language.parse_pathod("foo:b\xf0") def test_parse_header(self): @@ -263,7 +263,7 @@ class TestResponse: def test_websockets(self): r = next(language.parse_pathod("ws")) - with pytest.raises("no websocket key"): + with pytest.raises(Exception, match="No websocket key"): r.resolve(language.Settings()) res = r.resolve(language.Settings(websocket_key=b"foo")) assert res.status_code.string() == b"101" @@ -351,5 +351,5 @@ def test_nested_response_freeze(): def test_unique_components(): - with pytest.raises("multiple body clauses"): + with pytest.raises(Exception, match="multiple body clauses"): language.parse_pathod("400:b@1:b@1") |