Skip to content

Commit baf0f01

Browse files
authored
Remove stale xfail on schema-qualified INSERT parseutils test (#1625)
* Remove stale xfail on schema-qualified INSERT parseutils test test_simple_insert_single_table_schema_qualified was marked xfail for an old sqlparse that mislabeled schema-qualified INSERT statements. That is long fixed: the test passes across the supported range (sqlparse 0.3.0 through 0.6.x), so the marker only produced an XPASS. Because xfail_strict is not set, that XPASS was silent and the assertion never gated anything. Drop the decorator so the test guards extract_tables again. * 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. --------- Co-authored-by: Paco Cartones <pacocartones@users.noreply.github.com>
1 parent 101e523 commit baf0f01

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎tests/parseutils/test_parseutils.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def test_simple_insert_single_table():
106106
assert tables == ((None, "abc", "abc", False),)
107107

108108

109-
@pytest.mark.xfail
110109
def test_simple_insert_single_table_schema_qualified():
111110
tables = extract_tables('insert into abc.def (id, name) values (1, "def")')
112111
assert tables == (("abc", "def", None, False),)

‎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)