#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PYTHON="$ROOT_DIR/venv/bin/python"

if [[ ! -x "$PYTHON" ]]; then
  echo "ERROR: expected virtualenv Python at $PYTHON" >&2
  echo "Create the venv first, then run: venv/bin/python -m pytest" >&2
  exit 1
fi

exec "$PYTHON" -m pytest "$@"
