summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-12 14:39:05 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-12 14:39:05 -0700
commitfae3d94f7f3039d5d7b264b6b4aad69c6b03c9a4 (patch)
tree4482461b018aa857db73698b6385642063aabd42 /tests/test_parse.py
parent8ad44059d4d9ab5a8a7489a963dcb8de45ca3a0a (diff)
downloadsqlparse-fae3d94f7f3039d5d7b264b6b4aad69c6b03c9a4.tar.gz
Fix token-parent behavior
Closes issue #226
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 0f5af04..75a7ab5 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -390,3 +390,11 @@ def test_wildcard_multiplication():
p = sqlparse.parse('select 1 * 2 from dual')[0]
assert p.tokens[2][2].ttype == T.Operator
+
+
+def test_stmt_tokens_parents():
+ # see issue 226
+ sql = "CREATE TABLE test();"
+ stmt = sqlparse.parse(sql)[0]
+ for token in stmt.tokens:
+ assert token.has_ancestor(stmt)