aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-03-28 15:57:48 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2019-04-08 15:11:57 +0200
commit4a038e54cf95515f5d02d5dd88d240fe5fb5204e (patch)
treea39c9d0bcb1abf63419d3cf8785fd0c68565510b /_pytest
parent718721cbc725d3aa3db9fe2d606c81a56615a753 (diff)
downloadwee-slack-4a038e54cf95515f5d02d5dd88d240fe5fb5204e.tar.gz
Use StringIO from io
This is compatible with python 3, which StringIO from StringIO or cStringIO is not.
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/conftest.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/_pytest/conftest.py b/_pytest/conftest.py
index f744dae..951797a 100644
--- a/_pytest/conftest.py
+++ b/_pytest/conftest.py
@@ -32,6 +32,8 @@ def realish_eventrouter(mock_weechat):
e = EventRouter()
context = e.store_context(SlackRequest('xoxoxoxox', "rtm.start", {"meh": "blah"}))
rtmstartdata = open('_pytest/data/http/rtm.start.json', 'r').read()
+ if sys.version_info.major == 2:
+ rtmstartdata = rtmstartdata.decode('utf-8')
e.receive_httprequest_callback(context, 1, 0, rtmstartdata, 4)
while len(e.queue):
e.handle_next()