summaryrefslogtreecommitdiff
path: root/test/test_self.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_self.py')
-rw-r--r--test/test_self.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/test_self.py b/test/test_self.py
index 7a48ee0cd..ef5de96c5 100644
--- a/test/test_self.py
+++ b/test/test_self.py
@@ -14,10 +14,11 @@
import sys
import os
from os.path import join, dirname, abspath
-from cStringIO import StringIO
import tempfile
import unittest
+import six
+
from pylint.lint import Run
from pylint.reporters import BaseReporter
from pylint.reporters.text import *
@@ -61,7 +62,7 @@ class RunTC(unittest.TestCase):
def _runtest(self, args, reporter=None, out=None, code=28):
if out is None:
- out = StringIO()
+ out = six.StringIO()
try:
sys.stderr = sys.stdout = out
try:
@@ -85,15 +86,15 @@ class RunTC(unittest.TestCase):
def test_pkginfo(self):
"""Make pylint check itself."""
- self._runtest(['pylint.__pkginfo__'], reporter=TextReporter(StringIO()),
+ self._runtest(['pylint.__pkginfo__'], reporter=TextReporter(six.StringIO()),
code=0)
def test_all(self):
"""Make pylint check itself."""
reporters = [
- TextReporter(StringIO()),
- HTMLReporter(StringIO()),
- ColorizedTextReporter(StringIO())
+ TextReporter(six.StringIO()),
+ HTMLReporter(six.StringIO()),
+ ColorizedTextReporter(six.StringIO())
]
self._runtest(['pylint/test/functional/arguments.py'],
reporter=MultiReporter(reporters), code=1)
@@ -125,7 +126,7 @@ class RunTC(unittest.TestCase):
if sys.version_info < (3, 0):
strio = tempfile.TemporaryFile()
else:
- strio = StringIO()
+ strio = six.StringIO()
assert strio.encoding is None
self._runtest([join(HERE, 'regrtest_data/no_stdout_encoding.py')],
out=strio)