ml_switcheroo.generated_tests.runtime_builder¶

Runtime Module Logic Generator.

This module contains the logic to creating the runtime.py file required by generated tests. It injects shared helpers, cross-framework comparison logic, and determinism fixtures.

Functions¶

ensure_runtime_module(→ None)

Creates or updates the runtime.py module in the output directory.

Module Contents¶

ml_switcheroo.generated_tests.runtime_builder.ensure_runtime_module(out_dir: pathlib.Path, frameworks: List[str] | None = None, mgr: Any = None) → None¶

Creates or updates the runtime.py module in the output directory.

Injects: 1. Safe import blocks for all used frameworks (try/except ImportError). 2. Determinism fixtures. 3. Recursive result comparison logic (verify_results).

Parameters:
  • out_dir – Directory where the generated tests and runtime.py reside.

  • frameworks – List of frameworks to include imports for.

  • mgr – SemanticsManager for retrieving custom import templates.