From 65f732e4975849e46b668d6b92cbdac7db6d2abf Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Mon, 4 Aug 2025 11:24:46 +0200 Subject: [PATCH] Move run_tests.py directly to 'make test' --- Makefile | 2 +- run_tests.py | 50 -------------------------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100755 run_tests.py diff --git a/Makefile b/Makefile index fd1f660..8496477 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ test-deps: # Test the package test: @echo "Running tests..." - python3 run_tests.py + python3 -m pytest tests/ -v --tb=short # Rebuild and reinstall (useful during development) dev: clean build diff --git a/run_tests.py b/run_tests.py deleted file mode 100755 index 43dd4aa..0000000 --- a/run_tests.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python3 - -""" -Test runner script for kumacli - -Usage: - python run_tests.py # Run all tests - python run_tests.py --cov # Run tests with coverage - python run_tests.py tests/test_info.py # Run specific test file -""" - -import sys -import subprocess - - -def run_tests(args=None): - """Run pytest with optional arguments""" - # Use python3 explicitly for compatibility - cmd = ["python3", "-m", "pytest"] - - if args: - cmd.extend(args) - else: - cmd.extend(["tests/", "-v", "--tb=short"]) - - try: - result = subprocess.run(cmd, check=True) - return result.returncode - except subprocess.CalledProcessError as e: - print(f"Tests failed with exit code: {e.returncode}") - return e.returncode - except FileNotFoundError: - print("pytest not found. Install with: pip install pytest") - return 1 - - -def main(): - """Main entry point""" - if len(sys.argv) > 1: - # Pass through command line arguments - args = sys.argv[1:] - else: - args = None - - exit_code = run_tests(args) - sys.exit(exit_code) - - -if __name__ == "__main__": - main()