Remove stale xfail on schema-qualified INSERT parseutils test - #1625
Remove stale xfail on schema-qualified INSERT parseutils test#1625pacocartones wants to merge 2 commits into
Conversation
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.
| ``test_simple_insert_single_table_schema_qualified``. It was marked for an old | ||
| ``sqlparse`` that mislabeled schema-qualified ``INSERT``; the test now passes | ||
| across the supported ``sqlparse`` range (0.3.0 to 0.6.x), so the marker only | ||
| hid a passing test (an unreported XPASS, since ``xfail_strict`` is not set). |
There was a problem hiding this comment.
Please remove this. The changelog is for users of pgcli, who are unlikely to feel concerned and interested by this change.
Also, I am not sure that this warrants an addition in AUTHORS. Unless you really want your name there, of course...
|
Also, there is another |
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.
|
Good catch — thanks for pointing at 4e86201. I checked empirically: it's still needed. Dropping the marker makes |
Description
test_simple_insert_single_table_schema_qualifiedintests/parseutils/test_parseutils.pywas marked@pytest.mark.xfailback when anolder
sqlparsemislabeled schema-qualifiedINSERTstatements. That has longbeen fixed. The test now passes across the whole supported range
(
sqlparse >=0.3.0,<0.7— I checked 0.3.0 and 0.6.0), so the marker only everproduced an XPASS.
Since
xfail_strictisn't set, that XPASS was silent, which means the assertionwasn't actually guarding
extract_tablesanymore. This just drops the decoratorso the test does its job again. No production code changes.
Verified locally: the file passes repeatedly on both sqlparse 0.3.0 and 0.6.0,
and
ruff format/ruff checkare clean.Checklist
changelog.rst.AUTHORSfile (or it's already there).pip install pre-commit && pre-commit install).