mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 10:13:58 +00:00
26 lines
714 B
Bash
Executable File
26 lines
714 B
Bash
Executable File
#!/bin/bash
|
|
# Run all unit tests and generate a coverage report.
|
|
# Coverage config is in pyproject.toml [tool.coverage.*].
|
|
|
|
set -euo pipefail
|
|
|
|
export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}."
|
|
|
|
if python -c "import pytest_cov" 2>/dev/null; then
|
|
echo "Running tests with coverage..."
|
|
pytest \
|
|
--cov=knoe \
|
|
--cov-report=term-missing \
|
|
--cov-report=html \
|
|
--cov-report=xml \
|
|
tests/
|
|
RET=$?
|
|
echo "HTML coverage report: htmlcov/index.html"
|
|
echo "XML coverage report: coverage.xml"
|
|
exit $RET
|
|
else
|
|
echo "Warning: pytest-cov not found. Running tests without coverage."
|
|
echo "Install it with: pip install -r requirements-test.txt"
|
|
pytest tests/
|
|
fi
|