Skip to content

Commit 18f469c

Browse files
committed
Document the still-needed xfail on the multi-column sub-select test
dbaty asked whether the xfail on test_sub_select_multiple_col_name_completion (added in 4e86201 in 2015, without explanation) is still needed. It is: removing the marker makes the test fail on sqlparse 0.6.0. Parsing the incomplete 'SELECT a, FROM abc' still treats the token before the trailing comma ('a') as a table, so the Column suggestion carries table_refs for both 'a' and 'abc' instead of just 'abc'. Keep the marker but give it a reason so the 2015 gap dbaty flagged is closed: future readers see why the failure is expected instead of an undocumented decorator.
1 parent 0821f4b commit 18f469c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎tests/test_sqlcompletion.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,12 @@ def test_sub_select_col_name_completion():
450450
}
451451

452452

453-
@pytest.mark.xfail
453+
@pytest.mark.xfail(
454+
reason="Parsing an incomplete multi-column sub-select still misidentifies the "
455+
"token before the trailing comma as a table: 'SELECT a, FROM abc' yields "
456+
"table_refs for both 'a' and 'abc' instead of just 'abc'. Confirmed still "
457+
"failing on sqlparse 0.6.0."
458+
)
454459
def test_sub_select_multiple_col_name_completion():
455460
suggestions = suggest_type("SELECT * FROM (SELECT a, FROM abc", "SELECT * FROM (SELECT a, ")
456461
assert set(suggestions) == cols_etc("abc")

0 commit comments

Comments
 (0)