diff options
| author | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-06-12 14:39:05 -0700 |
|---|---|---|
| committer | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-06-12 14:39:05 -0700 |
| commit | fae3d94f7f3039d5d7b264b6b4aad69c6b03c9a4 (patch) | |
| tree | 4482461b018aa857db73698b6385642063aabd42 /tests/test_parse.py | |
| parent | 8ad44059d4d9ab5a8a7489a963dcb8de45ca3a0a (diff) | |
| download | sqlparse-fae3d94f7f3039d5d7b264b6b4aad69c6b03c9a4.tar.gz | |
Fix token-parent behavior
Closes issue #226
Diffstat (limited to 'tests/test_parse.py')
| -rw-r--r-- | tests/test_parse.py | 8 |
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) |
