Skip to content

Commit

Permalink
Moving the pytest check to next-to-last, adding fail_fast: true set…
Browse files Browse the repository at this point in the history
…ting. (#288)
  • Loading branch information
drewoldag authored Sep 26, 2023
1 parent 3d737fb commit 10d7c98
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions python-project-template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fail_fast: true
repos:

# Compare the local template version to the latest remote template version
Expand All @@ -22,21 +23,6 @@ repos:
language: system
entry: jupyter nbconvert --clear-output

# Run unit tests, verify that they pass. Note that coverage is run against
# the ./src directory here because that is what will be committed. In the
# github workflow script, the coverage is run against the installed package
# and uploaded to Codecov by calling pytest like so:
# `python -m pytest --cov=<package_name> --cov-report=xml`
- repo: local
hooks:
- id: pytest-check
name: Run unit tests
description: Run unit tests with pytest.
entry: bash -c "if python -m pytest --co -qq; then python -m pytest --cov=./src --cov-report=html; fi"
language: system
pass_filenames: false
always_run: true

# Prevents committing directly branches named 'main' and 'master'.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down Expand Up @@ -135,6 +121,21 @@ repos:
]
{% endif %}

# Run unit tests, verify that they pass. Note that coverage is run against
# the ./src directory here because that is what will be committed. In the
# github workflow script, the coverage is run against the installed package
# and uploaded to Codecov by calling pytest like so:
# `python -m pytest --cov=<package_name> --cov-report=xml`
- repo: local
hooks:
- id: pytest-check
name: Run unit tests
description: Run unit tests with pytest.
entry: bash -c "if python -m pytest --co -qq; then python -m pytest --cov=./src --cov-report=html; fi"
language: system
pass_filenames: false
always_run: true

{%- if include_notebooks %}
# Make sure Sphinx can build the documentation while explicitly omitting
# notebooks from the docs, so users don't have to wait through the execution
Expand Down

0 comments on commit 10d7c98

Please sign in to comment.