hydra.python.testing module

Python test code generation codec for pytest-based generation tests.

hydra.python.testing.build_python_test_module(test_module: T0, test_group: TestGroup, test_body: str) str

Build the complete Python test module content.

hydra.python.testing.format_python_test_name(name: str) str

Format a test name for Python (snake_case with test_ prefix).

hydra.python.testing.generate_python_test_case(group_path: Sequence[str], tcm: TestCaseWithMetadata) object

Generate a single pytest test case from a test case with metadata.

hydra.python.testing.generate_python_test_file(test_module: Module, test_group: TestGroup, _g: T0) object

Generate a Python test file for a test group.

hydra.python.testing.generate_python_test_group_hierarchy(group_path: Sequence[str], test_group: TestGroup) object

Generate test hierarchy for Python with nested subgroups.

hydra.python.testing.generate_test_file_with_python_codec(test_module: Module, test_group: TestGroup) object

Generate a complete test file for Python.