Skip to content

Commit 7a7d851

Browse files
authored
Improved test and pdb functions in Makefile
1 parent 2c91411 commit 7a7d851

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

{{cookiecutter.project_slug}}/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ clean-test: ## remove test and coverage artifacts
5151
ruff: ## check style
5252
ruff check
5353

54-
test: ## run tests quickly with the default Python
55-
pytest
54+
MAKECMDGOALS ?= .
55+
56+
test: ## Run all the tests, but allow for arguments to be passed
57+
@echo "Running with arg: $(filter-out $@,$(MAKECMDGOALS))"
58+
pytest $(filter-out $@,$(MAKECMDGOALS))
59+
60+
pdb: ## Run all the tests, but on failure, drop into the debugger
61+
@echo "Running with arg: $(filter-out $@,$(MAKECMDGOALS))"
62+
pytest --pdb --maxfail=10 --pdbcls=IPython.terminal.debugger:TerminalPdb $(filter-out $@,$(MAKECMDGOALS))
5663

5764
test-all: ## run tests on every Python version with uv
5865
uv run --python=3.10 --extra test pytest

0 commit comments

Comments
 (0)