tests.sh 373 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  4. cd "$ROOT_DIR"
  5. echo "Running tests (pytest)..."
  6. if command -v pytest >/dev/null 2>&1; then
  7. exec pytest -q
  8. elif command -v python >/dev/null 2>&1; then
  9. exec python -m pytest -q
  10. else
  11. echo "pytest/python not found in PATH. Install dependencies and retry." >&2
  12. exit 1
  13. fi