summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-10 20:27:13 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-11 04:34:18 -0700
commit2679ae8a7f39a84f54d546cb9d0388abf5acb156 (patch)
tree18db5e2759b37502b24aad9bea1adcb202119d2a /tests/test_parse.py
parent226e13f5724f8d87ac6359757a0cde180aa50b51 (diff)
downloadsqlparse-2679ae8a7f39a84f54d546cb9d0388abf5acb156.tar.gz
Improve test by splitting multiple asserts
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 146168b..8ada05c 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -178,9 +178,9 @@ def test_psql_quotation_marks(): # issue83
def test_double_precision_is_builtin():
sql = 'DOUBLE PRECISION'
t = sqlparse.parse(sql)[0].tokens
- assert (len(t) == 1
- and t[0].ttype == sqlparse.tokens.Name.Builtin
- and t[0].value == 'DOUBLE PRECISION')
+ assert len(t) == 1
+ assert t[0].ttype == sqlparse.tokens.Name.Builtin
+ assert t[0].value == 'DOUBLE PRECISION'
@pytest.mark.parametrize('ph', ['?', ':1', ':foo', '%s', '%(foo)s'])
@@ -218,10 +218,10 @@ def test_single_quotes_with_linebreaks(): # issue118
def test_sqlite_identifiers():
# Make sure we still parse sqlite style escapes
p = sqlparse.parse('[col1],[col2]')[0].tokens
- assert (len(p) == 1
- and isinstance(p[0], sqlparse.sql.IdentifierList)
- and [id.get_name() for id in p[0].get_identifiers()]
- == ['[col1]', '[col2]'])
+ id_names = [id.get_name() for id in p[0].get_identifiers()]
+ assert len(p) == 1
+ assert isinstance(p[0], sqlparse.sql.IdentifierList)
+ assert id_names == ['[col1]', '[col2]']
p = sqlparse.parse('[col1]+[col2]')[0]
types = [tok.ttype for tok in p.flatten()]
@@ -233,9 +233,9 @@ def test_simple_1d_array_index():
assert len(p) == 1
assert p[0].get_name() == 'col'
indices = list(p[0].get_array_indices())
- assert (len(indices) == 1 # 1-dimensional index
- and len(indices[0]) == 1 # index is single token
- and indices[0][0].value == '1')
+ assert len(indices) == 1 # 1-dimensional index
+ assert len(indices[0]) == 1 # index is single token
+ assert indices[0][0].value == '1'
def test_2d_array_index():