Upstream andialbrecht/sqlparse state of the touched files before f47b549867
This commit is contained in:
1 parent
f0a09a4a1b
commit
40155f3cf6
4 files changed
+9
-58
No files matched your search
@@ -241,27 +241,6 @@ def test_grouping_identifier_list_with_inline_comments():
|
||||
assert isinstance(p.tokens[0].tokens[3], sql.Identifier)
|
||||
|
||||
|
||||
def test_grouping_identifier_with_comments():
|
||||
# issue712: comments between the tokens of a (possibly aliased) dotted
|
||||
# identifier must not prevent it from being grouped.
|
||||
s = 'a\n-- c1\n.\n-- c2\nb'
|
||||
p = sqlparse.parse(s)[0]
|
||||
assert str(p) == s
|
||||
assert len([t for t in p.tokens if not t.is_whitespace]) == 1
|
||||
assert isinstance(p.tokens[0], sql.Identifier)
|
||||
assert p.tokens[0].get_parent_name() == 'a'
|
||||
assert p.tokens[0].get_real_name() == 'b'
|
||||
|
||||
s = 'ns -- a\n. -- b\n"tbl" -- c\nas -- d\nal'
|
||||
p = sqlparse.parse(s)[0]
|
||||
assert str(p) == s
|
||||
assert len([t for t in p.tokens if not t.is_whitespace]) == 1
|
||||
assert isinstance(p.tokens[0], sql.Identifier)
|
||||
assert p.tokens[0].get_parent_name() == 'ns'
|
||||
assert p.tokens[0].get_real_name() == 'tbl'
|
||||
assert p.tokens[0].get_alias() == 'al'
|
||||
|
||||
|
||||
def test_grouping_identifiers_with_operators():
|
||||
p = sqlparse.parse('a+b as c from table where (d-e)%2= 1')[0]
|
||||
assert len([x for x in p.flatten() if x.ttype == T.Name]) == 5
|
||||
|
||||
Reference in new issue
Block a user