summaryrefslogtreecommitdiff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-10-26 19:40:29 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2015-10-26 19:40:29 +0100
commite6a51a0bc3f87e284de74cec838d3ee98c2f9cf5 (patch)
tree8ac469820a09c31e9e49543ecbbbdeebad53c85e /tests/utils.py
parent8bfdaf3cc37ffe48a60c7f4ee5d5e99d0b07e696 (diff)
downloadsqlparse-e6a51a0bc3f87e284de74cec838d3ee98c2f9cf5.tar.gz
Use compat module for single Python 2/3 code base.
This change includes minor fixes and code cleanup too.
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 9eb46bf..b596ff4 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -6,9 +6,9 @@ import codecs
import difflib
import os
import unittest
-from StringIO import StringIO
import sqlparse.utils
+from sqlparse.compat import u, StringIO
NL = '\n'
DIR_PATH = os.path.abspath(os.path.dirname(__file__))
@@ -31,8 +31,8 @@ class TestCaseBase(unittest.TestCase):
def ndiffAssertEqual(self, first, second):
"""Like failUnlessEqual except use ndiff for readable output."""
if first != second:
- sfirst = unicode(first)
- ssecond = unicode(second)
+ sfirst = u(first)
+ ssecond = u(second)
# Using the built-in .splitlines() method here will cause incorrect
# results when splitting statements that have quoted CR/CR+LF
# characters.
@@ -42,5 +42,5 @@ class TestCaseBase(unittest.TestCase):
fp = StringIO()
fp.write(NL)
fp.write(NL.join(diff))
- print fp.getvalue()
- raise self.failureException, fp.getvalue()
+ # print(fp.getvalue())
+ raise self.failureException(fp.getvalue())