Skip to content

Commit 22a020a

Browse files
authored
fix: run pytest hook on unstaged files (#347)
1 parent 7b1860f commit 22a020a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ check-mypy:
167167
check:
168168
pre-commit run --all-files
169169

170-
# Run all unit tests.
170+
# Run all unit tests. The --files option avoids stashing but passes files; however,
171+
# the hook setup itself does not pass files to pytest (see .pre-commit-config.yaml).
171172
.PHONY: test
172173
test:
173-
pre-commit run pytest --hook-stage push
174+
pre-commit run pytest --hook-stage push --files test/
174175

175176
# Build a source distribution package and a binary wheel distribution artifact.
176177
# When building these artifacts, we need the environment variable SOURCE_DATE_EPOCH

0 commit comments

Comments
 (0)