test: cover the non-qmark paramstyle matrix - #8
Merged
Conversation
TT1: Dialect.placeholder() and format_params() support qmark/numeric/named/ format/pyformat, but only qmark was exercised anywhere. Add TestDialectParamStyles asserting the placeholder token shape per style and the list-vs-keyed-dict format_params contract, with no DB round-trip (pure transforms). numeric and named were previously untested; format/pyformat only ran under the PostgreSQL job. Closes TT1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P7 tests (closes TT1)
Dialect.placeholder()andDialect.format_params()support all five PEP 249paramstyles (
qmark/numeric/named/format/pyformat), but onlyqmark(the SQLite default) was exercised anywhere —
numeric/namedwere untested,and
format/pyformatonly ran under the PostgreSQL job.Adds
TestDialectParamStyles, which builds aDialectvia theenginefixture, overrides
.paramstyleper case, and asserts:placeholder(0)/placeholder(1)emit the right token (?,:1/:2,:p0/:p1,%s,%(p0)s/%(p1)s), including the no-arg default index;format_paramsreturns a list for positional styles and a{p0:.., p1:..}dict for the name-bearing styles — keys in lockstep withthe
:p0/%(p0)splaceholder tokens;?for an unknown style.No DB round-trip (pure string/collection transforms); characterization tests
that lock in already-correct behavior. Local gate green:
ruff,mypy,pytest(119 passed, 15 skipped).