Summary
pytest runs the full test suite on every git commit via pre-commit. This slows down the commit loop unnecessarily — linting and formatting catch most issues instantly, and tests can gate on push instead.
Change
Move the pytest hook from default_install_hook_types (pre-commit) to pre-push stage in .pre-commit-config.yaml:
- id: pytest
name: pytest
entry: uv run pytest --tb=short -q
language: system
types: [python]
pass_filenames: false
stages: [pre-push]
After updating the config, re-install hooks:
pre-commit install --hook-type pre-push
Why
- Commits stay fast (linting, formatting, type checks — seconds)
- Tests still run before code reaches the remote
- CI is the final safety net regardless
Summary
pytest runs the full test suite on every
git commitvia pre-commit. This slows down the commit loop unnecessarily — linting and formatting catch most issues instantly, and tests can gate on push instead.Change
Move the
pytesthook fromdefault_install_hook_types(pre-commit) topre-pushstage in.pre-commit-config.yaml:After updating the config, re-install hooks:
Why