summaryrefslogtreecommitdiff
path: root/tests/test_split.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_split.py')
-rw-r--r--tests/test_split.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/test_split.py b/tests/test_split.py
index a93e3d4..8214756 100644
--- a/tests/test_split.py
+++ b/tests/test_split.py
@@ -1,13 +1,11 @@
-# -*- coding: utf-8 -*-
-
# Tests splitting functions.
import types
+from io import StringIO
import pytest
import sqlparse
-from sqlparse.compat import StringIO, text_type
def test_split_semicolon():
@@ -33,7 +31,7 @@ def test_split_create_function(load_file, fn):
sql = load_file(fn)
stmts = sqlparse.parse(sql)
assert len(stmts) == 1
- assert text_type(stmts[0]) == sql
+ assert str(stmts[0]) == sql
def test_split_dashcomments(load_file):
@@ -74,12 +72,12 @@ def test_split_dropif():
def test_split_comment_with_umlaut():
- sql = (u'select * from foo;\n'
- u'-- Testing an umlaut: ä\n'
- u'select * from bar;')
+ sql = ('select * from foo;\n'
+ '-- Testing an umlaut: ä\n'
+ 'select * from bar;')
stmts = sqlparse.parse(sql)
assert len(stmts) == 2
- assert ''.join(text_type(q) for q in stmts) == sql
+ assert ''.join(str(q) for q in stmts) == sql
def test_split_comment_end_of_line():
@@ -125,11 +123,11 @@ def test_split_stream():
def test_split_encoding_parsestream():
stream = StringIO("SELECT 1; SELECT 2;")
stmts = list(sqlparse.parsestream(stream))
- assert isinstance(stmts[0].tokens[0].value, text_type)
+ assert isinstance(stmts[0].tokens[0].value, str)
def test_split_unicode_parsestream():
- stream = StringIO(u'SELECT ö')
+ stream = StringIO('SELECT ö')
stmts = list(sqlparse.parsestream(stream))
assert str(stmts[0]) == 'SELECT ö'