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_websocket.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_websocket.py')
-rw-r--r-- | test/pathod/test_language_websocket.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/pathod/test_language_websocket.py b/test/pathod/test_language_websocket.py index e61413da..20f6a3a6 100644 --- a/test/pathod/test_language_websocket.py +++ b/test/pathod/test_language_websocket.py @@ -1,8 +1,9 @@ +import pytest + from pathod import language from pathod.language import websockets import mitmproxy.net.websockets -from mitmproxy.test import tutils from . import tservers @@ -45,11 +46,8 @@ class TestWebsocketFrame: def test_parse_websocket_frames(self): wf = language.parse_websocket_frame("wf:x10") assert len(list(wf)) == 10 - tutils.raises( - language.ParseException, - language.parse_websocket_frame, - "wf:x" - ) + with pytest.raises(language.ParseException): + language.parse_websocket_frame("wf:x") def test_client_values(self): specs = [ @@ -132,7 +130,7 @@ class TestWebsocketFrame: assert frm.payload == b"abc" def test_knone(self): - with tutils.raises("expected 4 bytes"): + with pytest.raises("expected 4 bytes"): self.fr("wf:b'foo':mask:knone") def test_length(self): @@ -140,4 +138,5 @@ class TestWebsocketFrame: frm = self.fr("wf:l2:b'foo'") assert frm.header.payload_length == 2 assert frm.payload == b"fo" - tutils.raises("expected 1024 bytes", self.fr, "wf:l1024:b'foo'") + with pytest.raises("expected 1024 bytes"): + self.fr("wf:l1024:b'foo'") |