#!/usr/bin/env python3 # SPDX-FileCopyrightText: 2025 Alexander Kalinovsky # # SPDX-License-Identifier: MIT """Test runner script for QuickBot CLI.""" import shutil import subprocess import sys import typer def main() -> None: """Run the test suite using uv so deps aren't installed globally.""" uv_path = shutil.which("uv") if uv_path is None: typer.echo( "❌ 'uv' is not installed. Please install it (e.g., via 'pipx install uv') and retry.", ) sys.exit(2) # Run tests via uv ensuring the dev extra is available # This subprocess call is safe as it only runs pytest with known arguments result = subprocess.run([uv_path, "run", "--extra", "dev", "pytest", "tests/", "-v", "--tb=short"], check=False) # noqa: S603 if result.returncode == 0: typer.echo("✅ All tests passed!") sys.exit(0) else: typer.echo("❌ Some tests failed!") sys.exit(1) if __name__ == "__main__": main()