diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2014-01-28 15:16:12 +0100 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2014-01-28 15:16:12 +0100 |
| commit | d74ea26ec3a7f189ec00f6b949fd95082ba5b204 (patch) | |
| tree | 3253f7718a98a230f6d6a715150f9a46e3e80d31 /tests | |
| parent | ff6371f67540c03e7400ffa7a5a6bd8b48c0e2d6 (diff) | |
| download | sqlparse-d74ea26ec3a7f189ec00f6b949fd95082ba5b204.tar.gz | |
Fix parsing and formatting of statements containing EXCEPT keyword.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_regressions.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py index 423f2d6..395c2b6 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -218,3 +218,18 @@ def test_issue90(): ' "price" = 1,', ' "description" = NULL']) assert formatted == tformatted + + +def test_except_formatting(): + sql = 'SELECT 1 FROM foo WHERE 2 = 3 EXCEPT SELECT 2 FROM bar WHERE 1 = 2' + formatted = sqlparse.format(sql, reindent=True) + tformatted = '\n'.join([ + 'SELECT 1', + 'FROM foo', + 'WHERE 2 = 3', + 'EXCEPT', + 'SELECT 2', + 'FROM bar', + 'WHERE 1 = 2' + ]) + assert formatted == tformatted |
