Files
quickbot_cli/run_tests.py
Alexander Kalinovsky 2954913673
Some checks failed
CI / test (3.13) (push) Failing after 22s
initial release
2025-08-25 19:45:21 +03:00

39 lines
1006 B
Python
Executable File

#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2025 Alexander Kalinovsky <a@k8y.ru>
#
# 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()