Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions tests/test_postgres.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""PostgreSQL-targeted tests.

These exercise the dialect branches that the main SQLite suite cannot
reach: psycopg's `format` paramstyle (`%s` placeholders), introspection
via `information_schema`, the division SQL whose unaliased derived
tables PostgreSQL strictly rejects, and bag-mode INTERSECT ALL /
reach: psycopg's `pyformat` paramstyle (`%(p0)s` placeholders bound from
a dict; the bare `format`/`%s` style belongs to pg8000, not psycopg),
introspection via `information_schema`, the division SQL whose unaliased
derived tables PostgreSQL strictly rejects, and bag-mode INTERSECT ALL /
EXCEPT ALL (which SQLite does not implement at all).

Every test depends on the `pg_engine` fixture in conftest.py — that
Expand Down Expand Up @@ -51,10 +52,10 @@ def test_introspect_existing_table(self, pg_engine):
assert wrapped.schema().domains() == (int, str, float)

def test_select_with_string_param(self, pg_engine):
# Forces a parameterized SELECT through psycopg's `format`
# paramstyle: the compiler emits %s and binds "alpha" as a
# parameter. A regression in placeholder generation would surface
# here as a driver-level error.
# Forces a parameterized SELECT through psycopg's `pyformat`
# paramstyle: the compiler emits %(p0)s and binds "alpha" as a
# dict-keyed parameter (via Dialect.format_params). A regression in
# placeholder generation would surface here as a driver-level error.
r = pg_engine.create(
"pg_param",
{"id": int, "name": str},
Expand Down
Loading