Use pytest in the Makefile
This commit is contained in:
parent
78e2b726fb
commit
e8edac5287
14
Makefile
14
Makefile
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
PYTHON_VERSION = 3.11
|
PYTHON_VERSION = 3.11
|
||||||
VENV_DIR = .venv
|
VENV_DIR = .venv
|
||||||
|
PYTHON = $(VENV_DIR)/bin/python
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
@ -39,6 +40,14 @@ ensure-ruff:
|
|||||||
uv tool install ruff; \
|
uv tool install ruff; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ensure pytest is available
|
||||||
|
.PHONY: ensure-pytest
|
||||||
|
ensure-pytest:
|
||||||
|
@if ! $(PYTHON) -c "import pytest" 2>/dev/null; then \
|
||||||
|
echo "pytest required for testing. Installing pytest..."; \
|
||||||
|
uv pip install pytest; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Create virtual environment with uv
|
# Create virtual environment with uv
|
||||||
.PHONY: venv-init
|
.PHONY: venv-init
|
||||||
venv-init: expect-arm64 expect-uv
|
venv-init: expect-arm64 expect-uv
|
||||||
@ -81,10 +90,9 @@ check: ensure-ruff
|
|||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: ensure-pytest
|
||||||
# 🏗️ Running tests...
|
# 🏗️ Running tests...
|
||||||
# mock success stub for future test suite 😜
|
$(PYTHON) -m pytest
|
||||||
@true
|
|
||||||
# ✅ Tests completed
|
# ✅ Tests completed
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user