#!/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 \ "$@"