diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_grouping.py | 7 | ||||
| -rw-r--r-- | tests/test_parse.py | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 63a01f2..c2d8860 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -294,9 +294,10 @@ def test_grouping_subquery_no_parens(): assert isinstance(p.tokens[0], sql.Case) -def test_grouping_alias_returns_none(): - # see issue185 - p = sqlparse.parse('foo.bar')[0] +@pytest.mark.parametrize('s', ['foo.bar', 'x, y', 'x > y', 'x / y']) +def test_grouping_alias_returns_none(s): + # see issue185 and issue445 + p = sqlparse.parse(s)[0] assert len(p.tokens) == 1 assert p.tokens[0].get_alias() is None diff --git a/tests/test_parse.py b/tests/test_parse.py index f2a2bda..c28cb06 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -431,8 +431,8 @@ def test_get_real_name(): s = u"update a t set t.b=1" stmts = sqlparse.parse(s) assert len(stmts) == 1 - assert 'a' == stmts[0].get_real_name() - assert 't' == stmts[0].get_alias() + assert 'a' == stmts[0].tokens[2].get_real_name() + assert 't' == stmts[0].tokens[2].get_alias() def test_from_subquery(): |
