Skip to content

Testing

A real PostgreSQL is required

The suite binds the models to a real server and gives every test a freshly rebuilt schema. SQLite was removed on 2026-11-01. The server comes from the environment or from a shared scenarios file; CI uses a service container.

GHAT_DB_HOST=localhost GHAT_DB_PORT=5432 \
GHAT_DB_USER=github_actions_tracker GHAT_DB_PASSWORD=github_actions_tracker \
PYTHONPATH=tests .venv3.15/Scripts/python -m pytest tests -q

Without a server the tests skip and say why; in CI GHAT_TEST_PG_REQUIRED=1 turns that into a failure.

Scope

Run what you changed. A full suite against a remote server takes 3–5 minutes.

PYTHONPATH=tests .venv3.15/Scripts/python -m pytest tests/core -q
PYTHONPATH=tests .venv3.15/Scripts/python -m pytest tests/controllers -q

Static checks

.venv3.15/Scripts/ruff check src tests
.venv3.15/Scripts/black --check src tests
.venv3.15/Scripts/isort --check-only src tests