pytest-adbc-replay¶
Record ADBC database queries to cassette files and replay them in CI without warehouse credentials.
Installation¶
Or with uv:
Quick Start¶
Install a DuckDB ADBC driver (no credentials needed):
pyproject.toml — tell the plugin which drivers to intercept:
adbc_driver_duckdb.dbapi is the module path where connect() lives. See Finding the right module path for other drivers.
test_example.py — mark each test and call connect() normally:
import adbc_driver_duckdb.dbapi as duckdb
import pytest
@pytest.mark.adbc_cassette("my_query")
def test_my_query():
conn = duckdb.connect()
with conn.cursor() as cur:
cur.execute("SELECT 42 AS answer")
assert cur.fetchone() == (42,)
No conftest.py needed. Record cassettes on the first run:
Replay from cassettes (default, no flag needed):
Cassette files land in tests/cassettes/my_query/adbc_driver_duckdb.dbapi/ — commit them to version control so CI can replay without a live database connection.
Where to go next¶
New to pytest-adbc-replay? Start with the Tutorial — it walks through a full record-then-replay cycle from scratch using DuckDB.
Looking for a specific task? The How-To Guides cover CI setup, cassette naming, multiple drivers, and scrubbing sensitive values.
Need exact config values or fixture signatures? Check the Reference.
Want to understand why the plugin works the way it does? The Explanation covers the cassette format, SQL normalisation, and record-mode semantics.