Local Development
Schema File Mode
The easiest local setup is a schema file:
from sqlproof import SqlProof
proof = SqlProof.from_schema_file("./schema.sql")SqlProof can manage disposable Postgres instances through the optional testcontainers extra:
pip install "sqlproof[testcontainers]"Docker must be running when using testcontainers.
Local Postgres
If you already run Postgres locally, point SqlProof at a test database:
export DATABASE_URL=postgresql://postgres:test@localhost:5432/postgresimport osfrom sqlproof import SqlProof
proof = SqlProof.from_connection_string(os.environ["DATABASE_URL"])Use a dedicated development or CI database. Never run generated-data tests against production.
Pytest
SqlProof tests run with normal pytest:
pytestpytest --sqlproof-runs=200pytest --sqlproof-seed=1708891234The pytest plugin is auto-discovered from the installed package and adds the
--sqlproof-* options.