Skip to content

Commit

Permalink
test: import StringIO from the io module when on python3
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tornblom committed Oct 19, 2017
1 parent 6723579 commit 951136c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
import tempfile
import sys
import os
import StringIO
import logging

try:
# python2
from StringIO import StringIO
except ImportError:
# python3
from io import StringIO

import rsl


Expand All @@ -16,7 +22,7 @@ class TestCommandLineInterface(unittest.TestCase):
def setUp(self):
self.temp_files = set()
logger = logging.getLogger()
self.log = logging.StreamHandler(StringIO.StringIO())
self.log = logging.StreamHandler(StringIO())
logger.addHandler(self.log)

def tearDown(self):
Expand Down

0 comments on commit 951136c

Please sign in to comment.