Skip to content

Commit 77c1b2a

Browse files
committed
Improves test workflow and updates dependencies
Simplifies test command to prefer pytest with a fallback to unittest, ensures Redis is available before testing, and consistently tears down Redis afterward. Updates multiple Python dependencies to their latest versions for improved security, stability, and compatibility.
1 parent ba087df commit 77c1b2a

2 files changed

Lines changed: 107 additions & 110 deletions

File tree

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all clean build install uninstall test publish redis redis-down
1+
.PHONY: all clean build install uninstall test publish redis-up redis-down
22

33
# Default target
44
all: clean build
@@ -23,14 +23,11 @@ uninstall:
2323
pip uninstall -y flowdacity-queue
2424

2525
# Run tests — prefers pytest, falls back to python modules
26-
test:
27-
@if python -c "import pytest" 2>/dev/null; then \
28-
python -m pytest -q; \
29-
else \
30-
echo 'pytest not installed — running direct test modules'; \
31-
python -m tests.test_queue; \
32-
python -m tests.test_func; \
33-
fi
26+
test: redis-up
27+
@status=0; \
28+
uv run pytest tests || uv run python -m unittest discover -s tests || status=$$?; \
29+
$(MAKE) redis-down; \
30+
exit $$status
3431

3532
publish: clean
3633
uv sync --group dev
@@ -40,7 +37,7 @@ publish: clean
4037
uv run python -m twine upload dist/*
4138

4239
# Start Redis container
43-
redis:
40+
redis-up:
4441
docker compose up -d redis
4542

4643
# Stop Redis container

0 commit comments

Comments
 (0)