diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-05 22:19:41 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-05 22:19:41 +0200 |
commit | e21db0d39b3f415c5c00a71bac4c726f84ed8f44 (patch) | |
tree | 8cf68825b457b4e151799dbe8930a9b2e420e86d /_pytest/conftest.py | |
parent | 0939fd32fbd6d2763187919c6cc06088a79a3c6d (diff) | |
download | wee-slack-e21db0d39b3f415c5c00a71bac4c726f84ed8f44.tar.gz |
Fix broken tests
I forgot to make some required changes in the tests after commit f3d880e
and commit 49d481c.
Diffstat (limited to '_pytest/conftest.py')
-rw-r--r-- | _pytest/conftest.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/_pytest/conftest.py b/_pytest/conftest.py index 043b125..0a770c7 100644 --- a/_pytest/conftest.py +++ b/_pytest/conftest.py @@ -3,6 +3,7 @@ from __future__ import print_function, unicode_literals import json import pytest import random +import ssl import string import sys @@ -22,7 +23,10 @@ class fakewebsocket(object): def recv(self): return self.recv_data()[1].decode('utf-8') def recv_data(self, control_frame=False): - return ABNF.OPCODE_TEXT, self.returndata.pop(0) + if self.returndata: + return ABNF.OPCODE_TEXT, self.returndata.pop(0) + else: + raise ssl.SSLWantReadError() def send(self, data): self.sentdata.append(data) @@ -33,6 +37,7 @@ def mock_websocket(): @pytest.fixture def realish_eventrouter(mock_websocket, mock_weechat): e = EventRouter() + wee_slack.EVENTROUTER = e context = e.store_context(SlackRequest('xoxs-token', 'rtm.start', {})) with open('_pytest/data/http/rtm.start.json') as rtmstartfile: if sys.version_info.major == 2: |