Files
flares/run_tests.sh
Hermes d98bcddcf1
Test Suite / test (push) Canceled after 0s
fix: Use glob pattern for python path matching
2026-11-07 16:40:02 -07:00

42 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Run pytest tests with proper Python path
cd "$(dirname "$0")"
# Find python with pytest support (Hermes environment or system)
PYTHON=""
# Try Hermes python first
for p in /opt/hermes/tools/python-*/bin/python; do
if [ -f "$p" ] && "$p" -c "import pytest" 2>/dev/null; then
PYTHON="$p"
break
fi
done
# Fall back to system python3 with pytest
if [ -z "$PYTHON" ]; then
for cmd in python3 python; do
if command -v $cmd &>/dev/null && $cmd -c "import pytest" 2>/dev/null; then
PYTHON="$cmd"
break
fi
done
fi
# Error if no suitable python found
if [ -z "$PYTHON" ]; then
echo "Error: pytest not found. Try:"
echo " pip install pytest numpy psutil Pillow"
exit 1
fi
echo "Running tests with: $PYTHON"
# Run all tests except GUI-dependent ones (requires PySide6)
$PYTHON -m pytest tests/unit/ \
--ignore=tests/unit/test_updater.py \
--ignore=tests/unit/test_plugin_manager.py \
--ignore=tests/unit/test_flares.py \
"$@"