From d27d3b793e21f2c22b0e7fc886440b1ec40d0a11 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Mon, 11 Aug 2025 20:47:48 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/partners/openai/fix_test_annotations.py | 39 -------------------- 1 file changed, 39 deletions(-) delete mode 100644 libs/partners/openai/fix_test_annotations.py diff --git a/libs/partners/openai/fix_test_annotations.py b/libs/partners/openai/fix_test_annotations.py deleted file mode 100644 index ecc882a2d96..00000000000 --- a/libs/partners/openai/fix_test_annotations.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -"""Script to add missing return type annotations to test functions.""" - -import re - -def fix_test_file(file_path): - """Fix missing return type annotations in a test file.""" - with open(file_path, 'r') as f: - content = f.read() - - # Pattern to match test functions without return type annotations - pattern = r'(def test_[^(]*\([^)]*\)):' - - def replace_func(match): - func_def = match.group(1) - return f"{func_def} -> None:" - - # Replace all test function definitions - new_content = re.sub(pattern, replace_func, content) - - # Also fix other common test function patterns - patterns = [ - (r'(def mock_[^(]*\([^)]*\)):', r'\1 -> None:'), - (r'(def setup_[^(]*\([^)]*\)):', r'\1 -> None:'), - (r'(def teardown_[^(]*\([^)]*\)):', r'\1 -> None:'), - ] - - for pattern, replacement in patterns: - new_content = re.sub(pattern, replacement, new_content) - - with open(file_path, 'w') as f: - f.write(new_content) - - print(f"Fixed return type annotations in {file_path}") - -if __name__ == "__main__": - # Fix both test files - fix_test_file('tests/unit_tests/chat_models/test_batch.py') - fix_test_file('tests/integration_tests/chat_models/test_batch_integration.py')