diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-02-01 16:48:46 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-02-02 12:59:01 +0100 |
commit | ae008ed80b870688e4e0fe5ff305dc40c17458b4 (patch) | |
tree | e5d9fcd24a403f7491d0d6e42364bf91fdb2ac6e /test/pathod/test_language_http2.py | |
parent | ec92d7f67e3c5960d9b30e067fb4ed1ae3fc8884 (diff) | |
download | mitmproxy-ae008ed80b870688e4e0fe5ff305dc40c17458b4.tar.gz mitmproxy-ae008ed80b870688e4e0fe5ff305dc40c17458b4.tar.bz2 mitmproxy-ae008ed80b870688e4e0fe5ff305dc40c17458b4.zip |
replace tutils.raises with pytest.raises + shim
Diffstat (limited to 'test/pathod/test_language_http2.py')
-rw-r--r-- | test/pathod/test_language_http2.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/pathod/test_language_http2.py b/test/pathod/test_language_http2.py index 8ab1acae..fdb65a63 100644 --- a/test/pathod/test_language_http2.py +++ b/test/pathod/test_language_http2.py @@ -1,4 +1,5 @@ import io +import pytest from mitmproxy.net import tcp from mitmproxy.net.http import user_agents @@ -7,8 +8,6 @@ from pathod import language from pathod.language import http2 from pathod.protocols.http2 import HTTP2StateProtocol -from mitmproxy.test import tutils - def parse_request(s): return next(language.parse_pathoc(s, True)) @@ -40,10 +39,12 @@ class TestRequest: assert req.values(default_settings()) == req.values(default_settings()) def test_nonascii(self): - tutils.raises("ascii", parse_request, "get:\xf0") + with pytest.raises("ascii"): + parse_request("get:\xf0") def test_err(self): - tutils.raises(language.ParseException, parse_request, 'GET') + with pytest.raises(language.ParseException): + parse_request('GET') def test_simple(self): r = parse_request('GET:"/foo"') @@ -167,10 +168,12 @@ class TestResponse: assert res.values(default_settings()) == res.values(default_settings()) def test_nonascii(self): - tutils.raises("ascii", parse_response, "200:\xf0") + with pytest.raises("ascii"): + parse_response("200:\xf0") def test_err(self): - tutils.raises(language.ParseException, parse_response, 'GET:/') + with pytest.raises(language.ParseException): + parse_response('GET:/') def test_raw_content_length(self): r = parse_response('200:r') |