pg-import-is-deferred

IN premise

`PgApi` is imported inside the `pg_api` fixture body, not at module top-level, so the test suite loads without Postgres dependencies when running SQLite-only tests.

Summary

The Postgres API class is lazily imported only when the pg_api test fixture actually runs, rather than being imported at the top of the test file. This means test files can be collected and SQLite-only tests can execute even on machines where Postgres client libraries aren't installed, avoiding unnecessary import errors.

Details

Sourceentries/2026/04/29/tests-conftest.md