Skip to content

test: cover the non-qmark paramstyle matrix - #8

Merged
Xof merged 1 commit into
mainfrom
test/paramstyle-matrix
Jun 21, 2026
Merged

test: cover the non-qmark paramstyle matrix#8
Xof merged 1 commit into
mainfrom
test/paramstyle-matrix

Conversation

@Xof

@Xof Xof commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

P7 tests (closes TT1)

Dialect.placeholder() and Dialect.format_params() support all five PEP 249
paramstyles (qmark/numeric/named/format/pyformat), but only qmark
(the SQLite default) was exercised anywhere — numeric/named were untested,
and format/pyformat only ran under the PostgreSQL job.

Adds TestDialectParamStyles, which builds a Dialect via the engine
fixture, overrides .paramstyle per 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_params returns a list for positional styles and a
    {p0:.., p1:..} dict for the name-bearing styles — keys in lockstep with
    the :p0 / %(p0)s placeholder tokens;
  • the wildcard arm falls back to ? 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).

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.
@Xof
Xof merged commit 609888b into main Jun 21, 2026
6 checks passed
@Xof
Xof deleted the test/paramstyle-matrix branch June 21, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant