diff --git a/packages/codeflash-api/src/codeflash_api/testgen/schemas.py b/packages/codeflash-api/src/codeflash_api/testgen/schemas.py index bd9979c..4599e98 100644 --- a/packages/codeflash-api/src/codeflash_api/testgen/schemas.py +++ b/packages/codeflash-api/src/codeflash_api/testgen/schemas.py @@ -14,6 +14,8 @@ class TestGenRequest(BaseModel): Request body for POST /ai/testgen. """ + __test__ = False + source_code_being_tested: str function_name: str module_path: str @@ -50,6 +52,8 @@ class TestGenResponse(BaseModel): Successful response from POST /ai/testgen. """ + __test__ = False + generated_tests: str raw_generated_tests: str | None = None @@ -59,6 +63,8 @@ class TestGenErrorResponse(BaseModel): Error response from testgen endpoints. """ + __test__ = False + error: str trace_id: str | None = None @@ -71,6 +77,8 @@ class TestSourceWithFailures(BaseModel): A test source file with optional behavioral test failures. """ + __test__ = False + test_source: str test_index: int failed_test_functions: list[str] = [] @@ -107,6 +115,8 @@ class TestgenReviewRequest(BaseModel): Request body for POST /ai/testgen_review. """ + __test__ = False + tests: list[TestSourceWithFailures] function_source_code: str function_name: str @@ -133,6 +143,8 @@ class TestReview(BaseModel): Review result for one test source. """ + __test__ = False + test_index: int functions: list[FunctionVerdict] @@ -142,6 +154,8 @@ class TestgenReviewResponse(BaseModel): Response from POST /ai/testgen_review. """ + __test__ = False + reviews: list[TestReview] @@ -162,6 +176,8 @@ class TestRepairRequest(BaseModel): Request body for POST /ai/testgen_repair. """ + __test__ = False + test_source: str functions_to_repair: list[FunctionToRepair] function_source_code: str @@ -199,4 +215,6 @@ class TestRepairResponse(BaseModel): Response from POST /ai/testgen_repair. """ + __test__ = False + generated_tests: str diff --git a/packages/codeflash-python/src/codeflash_python/_model.py b/packages/codeflash-python/src/codeflash_python/_model.py index ec40f3c..2154629 100644 --- a/packages/codeflash-python/src/codeflash_python/_model.py +++ b/packages/codeflash-python/src/codeflash_python/_model.py @@ -131,6 +131,8 @@ class FunctionToOptimize: class TestingMode(enum.Enum): """Mode for test instrumentation.""" + __test__ = False + BEHAVIOR = "behavior" PERFORMANCE = "performance" LINE_PROFILE = "line_profile" diff --git a/packages/codeflash-python/src/codeflash_python/test_discovery/linking.py b/packages/codeflash-python/src/codeflash_python/test_discovery/linking.py index 693a35e..57b57ec 100644 --- a/packages/codeflash-python/src/codeflash_python/test_discovery/linking.py +++ b/packages/codeflash-python/src/codeflash_python/test_discovery/linking.py @@ -43,6 +43,8 @@ FUNCTION_NAME_REGEX = re.compile( class TestFunction: """A test function discovered within a test file.""" + __test__ = False + function_name: str test_class: str | None parameters: str | None diff --git a/packages/codeflash-python/src/codeflash_python/test_discovery/models.py b/packages/codeflash-python/src/codeflash_python/test_discovery/models.py index 6649697..9f5456d 100644 --- a/packages/codeflash-python/src/codeflash_python/test_discovery/models.py +++ b/packages/codeflash-python/src/codeflash_python/test_discovery/models.py @@ -11,6 +11,8 @@ import attrs class TestType(enum.IntEnum): """Type of test discovered.""" + __test__ = False + EXISTING_UNIT_TEST = 1 INSPIRED_REGRESSION = 2 GENERATED_REGRESSION = 3 @@ -44,6 +46,8 @@ class CodePosition: class TestsInFile: """A test function found in a test file.""" + __test__ = False + test_file: Path = attrs.field(converter=Path) test_class: str | None test_function: str diff --git a/packages/codeflash-python/src/codeflash_python/testing/_testgen.py b/packages/codeflash-python/src/codeflash_python/testing/_testgen.py index 1ebca41..83591b2 100644 --- a/packages/codeflash-python/src/codeflash_python/testing/_testgen.py +++ b/packages/codeflash-python/src/codeflash_python/testing/_testgen.py @@ -56,6 +56,8 @@ class GeneratedTestsList: class TestgenPayload: """Typed payload for the ``/ai/testgen`` endpoint.""" + __test__ = False + source_code_being_tested: str function_to_optimize: dict[str, object] helper_function_names: list[str] diff --git a/packages/codeflash-python/src/codeflash_python/testing/models.py b/packages/codeflash-python/src/codeflash_python/testing/models.py index 1b8e0e9..9c92601 100644 --- a/packages/codeflash-python/src/codeflash_python/testing/models.py +++ b/packages/codeflash-python/src/codeflash_python/testing/models.py @@ -156,6 +156,8 @@ class FunctionTestInvocation: class TestResults: """Collection of test invocation results.""" + __test__ = False + test_results: list[FunctionTestInvocation] = attrs.Factory(list) test_result_idx: dict[str, int] = attrs.Factory(dict) perf_stdout: str | None = None @@ -324,6 +326,8 @@ class TestResults: class TestFile: """A test file ready for execution.""" + __test__ = False + original_file_path: Path = attrs.field(converter=Path) instrumented_behavior_file_path: Path | None = None benchmarking_file_path: Path | None = None @@ -335,6 +339,8 @@ class TestFile: class TestFiles: """Collection of test files for a test run.""" + __test__ = False + test_files: list[TestFile] = attrs.Factory(list) def get_test_type_by_instrumented_file_path( @@ -372,6 +378,8 @@ class TestFiles: class TestConfig: """Configuration for test execution.""" + __test__ = False + tests_project_rootdir: Path = attrs.field(converter=Path) test_framework: str = "pytest" pytest_cmd: str = "pytest"