Skip to content

chore(ci): move pytest from pre-commit to pre-push hook #406

Description

@Alberto-Codes

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions