Use pytest in the Makefile

This commit is contained in:
filipstrand 2024-10-10 00:00:32 +02:00
parent 78e2b726fb
commit e8edac5287

View File

@ -2,6 +2,7 @@
PYTHON_VERSION = 3.11
VENV_DIR = .venv
PYTHON = $(VENV_DIR)/bin/python
# Default target
.PHONY: all
@ -39,6 +40,14 @@ ensure-ruff:
uv tool install ruff; \
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
.PHONY: venv-init
venv-init: expect-arm64 expect-uv
@ -81,10 +90,9 @@ check: ensure-ruff
# Run tests
.PHONY: test
test:
test: ensure-pytest
# 🏗️ Running tests...
# mock success stub for future test suite 😜
@true
$(PYTHON) -m pytest
# ✅ Tests completed
# Clean up