#!/usr/bin/env python3 """ Quick test runner for individual test categories. Usage: python scripts/quick_test.py unit # Run only unit tests python scripts/quick_test.py integration # Run only integration tests python scripts/quick_test.py theme # Test theme functionality python scripts/quick_test.py all # Run all tests (default) """ import subprocess import sys from pathlib import Path def run_unit_tests(): """Run unit tests only.""" cmd = [sys.executable, "-m", "pytest", "tests/", "--verbose", "-x", "--tb=short"] return subprocess.run(cmd).returncode == 0 def run_integration_tests(): """Run integration tests only.""" cmd = [ sys.executable, "-m", "pytest", "tests/test_integration.py", "--verbose", "-s", ] return subprocess.run(cmd).returncode == 0 def run_theme_tests(): """Run theme-related tests only.""" cmd = [ sys.executable, "-m", "pytest", "tests/test_integration.py::TestIntegrationSuite::test_theme_changing_functionality", "tests/test_integration.py::TestIntegrationSuite::test_menu_theming_integration", "tests/test_theme_manager.py", "--verbose", "-s", ] return subprocess.run(cmd).returncode == 0 def run_all_tests(): """Run the full test suite.""" return subprocess.run([sys.executable, "scripts/run_tests.py"]).returncode == 0 def main(): """Main test runner.""" # Change to project root project_root = Path(__file__).parent.parent import os os.chdir(project_root) test_type = sys.argv[1] if len(sys.argv) > 1 else "all" runners = { "unit": run_unit_tests, "integration": run_integration_tests, "theme": run_theme_tests, "all": run_all_tests, } if test_type not in runners: print(f"Unknown test type: {test_type}") print("Available options: unit, integration, theme, all") sys.exit(1) print(f"Running {test_type} tests...") success = runners[test_type]() if success: print(f"✓ {test_type.title()} tests passed!") sys.exit(0) else: print(f"✗ {test_type.title()} tests failed!") sys.exit(1) if __name__ == "__main__": main()