From 8cf99dd928a69ecf3176f9e12d0c4ebce51dd339 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sun, 21 Sep 2025 23:39:21 +0800 Subject: [PATCH] refactor(tests): remove deprecated test runner script --- run_tests.py | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 run_tests.py diff --git a/run_tests.py b/run_tests.py deleted file mode 100644 index af5f96ff..00000000 --- a/run_tests.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python3 -""" -Test runner script for ComfyUI-Lora-Manager. - -This script runs pytest from the tests directory to avoid import issues -with the root __init__.py file. -""" -import subprocess -import sys -import os -from pathlib import Path - -# Set environment variable to indicate standalone mode -# HF_HUB_DISABLE_TELEMETRY is from ComfyUI main.py -standalone_mode = os.environ.get("HF_HUB_DISABLE_TELEMETRY", "0") == "0" - -def main(): - """Run pytest from the tests directory to avoid import issues.""" - # Get the script directory - script_dir = Path(__file__).parent.absolute() - tests_dir = script_dir / "tests" - - if not tests_dir.exists(): - print(f"Error: Tests directory not found at {tests_dir}") - return 1 - - # Change to tests directory - original_cwd = os.getcwd() - os.chdir(tests_dir) - - try: - # Build pytest command - cmd = [ - sys.executable, "-m", "pytest", - "-v", - "--rootdir=.", - ] + sys.argv[1:] # Pass any additional arguments - - print(f"Running: {' '.join(cmd)}") - print(f"Working directory: {tests_dir}") - - # Run pytest - result = subprocess.run(cmd, cwd=tests_dir) - return result.returncode - finally: - # Restore original working directory - os.chdir(original_cwd) - -if __name__ == "__main__": - sys.exit(main())