Skip to content

Commit

Permalink
Merge pull request #4 from Gusgus01/63-trackerevent_str_error
Browse files Browse the repository at this point in the history
Fix Python 2 issues with test_event_print.
  • Loading branch information
StoicLoofah authored Nov 4, 2018
2 parents a66278d + 8c90728 commit f16dddd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test_replays/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import unittest
# StringIO was changed in python 3
try:
from io import StringIO
except ImportError:
from StringIO import StringIO
except ImportError:
from io import StringIO

import sc2reader
from sc2reader.exceptions import CorruptTrackerFileError
Expand Down Expand Up @@ -589,12 +589,12 @@ def test_65895(self):

def test_event_print(self):
replay = sc2reader.load_replay("test_replays/lotv/lotv1.SC2Replay")
with StringIO() as capturedOutput:
sys.stdout = capturedOutput
for event in replay.events:
print(event)
self.assertIn("PlayerLeaveEvent", capturedOutput.getvalue())
sys.stdout = sys.__stdout__
sys.stdout = capturedOutput = StringIO()
for event in replay.events:
print(event)
self.assertIn("PlayerLeaveEvent", capturedOutput.getvalue())
sys.stdout = sys.__stdout__
capturedOutput.close()


class TestGameEngine(unittest.TestCase):
Expand Down

0 comments on commit f16dddd

Please sign in to comment.