Main entry point for test organization.
()
| 16 | |
| 17 | |
| 18 | def main() -> None: |
| 19 | """Main entry point for test organization.""" |
| 20 | if len(sys.argv) != 2: |
| 21 | print("Usage: organize_tests.py <tests_directory>", file=sys.stderr) |
| 22 | sys.exit(1) |
| 23 | |
| 24 | tests_dir = Path(sys.argv[1]).resolve() |
| 25 | |
| 26 | if not tests_dir.exists(): |
| 27 | print(f"Error: Tests directory not found: {tests_dir}", file=sys.stderr) |
| 28 | sys.exit(1) |
| 29 | |
| 30 | # Discover all test files |
| 31 | test_files = discover_test_files(tests_dir, EXCLUDED_TEST_FILES, EXCLUDED_TEST_DIRS) |
| 32 | |
| 33 | for test_file_path in test_files: |
| 34 | if not test_file_path: # Skip empty strings |
| 35 | continue |
| 36 | |
| 37 | test_name = extract_test_name(test_file_path) |
| 38 | category = categorize_test(test_name, test_file_path) |
| 39 | |
| 40 | # Output in parseable format |
| 41 | print(f"TEST:{test_name}:{test_file_path}:{category}") |
| 42 | |
| 43 | |
| 44 | if __name__ == "__main__": |
no test coverage detected