Skip to content

Instantly share code, notes, and snippets.

@adriantorrie
Created November 18, 2020 03:19
Show Gist options
  • Save adriantorrie/c055ca7f3ce6b73a5ec0be014edd7e3b to your computer and use it in GitHub Desktop.
Save adriantorrie/c055ca7f3ce6b73a5ec0be014edd7e3b to your computer and use it in GitHub Desktop.
Pytest pre-commit hook
# https://github.com/pre-commit/pre-commit/issues/761#issuecomment-394167542
- repo: local
hooks:
- id: pytest
name: pytest
entry: venv/bin/pytest
language: script
pass_filenames: false
# alternatively you could `types: [python]` so it only runs when python files change
# though tests might be invalidated if you were to say change a data file
always_run: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment