Among the many changes we switch to using SQLAlchemy's connection pool, which means we are no longer required to guard against multiple threads working on the database. All db funcs now receive a connection to use as their first argument, this allows the caller to control transaction & rollback behavior.
15 lines
458 B
Bash
Executable file
15 lines
458 B
Bash
Executable file
#!/bin/sh -eu
|
|
|
|
cd "$RUN_DIR"
|
|
|
|
dbfile="${UNWIND_DATA:-./data}/tests.sqlite"
|
|
|
|
# Rollback in Databases is currently broken, so we have to rebuild the database
|
|
# each time; see https://github.com/encode/databases/issues/403
|
|
trap 'rm "$dbfile" "${dbfile}-shm" "${dbfile}-wal"' EXIT TERM INT QUIT
|
|
|
|
[ -z "${DEBUG:-}" ] || set -x
|
|
|
|
export SQLALCHEMY_WARN_20=1 # XXX remove when we switched to SQLAlchemy 2.0
|
|
UNWIND_STORAGE="$dbfile" \
|
|
python -m pytest --cov "$@"
|