summaryrefslogtreecommitdiff
path: root/tests/test_split.py
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-19 09:13:36 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-20 07:40:20 -0700
commitc9e8230502fd2c72833a2ea4d2c6bac9234e580a (patch)
tree3def49609e6821ef25ffef38741e7b134de31ccd /tests/test_split.py
parent64b9d3537783dbf761b421644ba07078a80b5640 (diff)
downloadsqlparse-c9e8230502fd2c72833a2ea4d2c6bac9234e580a.tar.gz
Replace tests/utils with conftest.py
http://stackoverflow.com/questions/34466027/what-is-the-use-of-conftest-py
Diffstat (limited to 'tests/test_split.py')
-rw-r--r--tests/test_split.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/test_split.py b/tests/test_split.py
index 72f9682..5968806 100644
--- a/tests/test_split.py
+++ b/tests/test_split.py
@@ -8,7 +8,6 @@ import pytest # noqa
import sqlparse
from sqlparse.compat import StringIO, text_type
-from tests.utils import load_file
class SQLSplitTest(object):
@@ -28,31 +27,31 @@ class SQLSplitTest(object):
stmts = sqlparse.parse(r"select '\\'; select '\''; select '\\\'';")
assert len(stmts) == 3
- def test_create_function(self):
+ def test_create_function(self, load_file):
sql = load_file('function.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 1
assert str(stmts[0]) == sql
- def test_create_function_psql(self):
+ def test_create_function_psql(self, load_file):
sql = load_file('function_psql.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 1
assert str(stmts[0]) == sql
- def test_create_function_psql3(self):
+ def test_create_function_psql3(self, load_file):
sql = load_file('function_psql3.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 1
assert str(stmts[0]) == sql
- def test_create_function_psql2(self):
+ def test_create_function_psql2(self, load_file):
sql = load_file('function_psql2.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 1
assert str(stmts[0]) == sql
- def test_dashcomments(self):
+ def test_dashcomments(self, load_file):
sql = load_file('dashcomment.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 3
@@ -68,13 +67,13 @@ class SQLSplitTest(object):
stmts = sqlparse.parse('select foo; -- comment')
assert len(stmts) == 1
- def test_begintag(self):
+ def test_begintag(self, load_file):
sql = load_file('begintag.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 3
assert ''.join(str(q) for q in stmts) == sql
- def test_begintag_2(self):
+ def test_begintag_2(self, load_file):
sql = load_file('begintag_2.sql')
stmts = sqlparse.parse(sql)
assert len(stmts) == 1