Convert failing tests to patch format.
(
test_parts_set: set[tuple[str, str]],
error_messages: dict[tuple[str, str], str] | None = None,
)
| 344 | |
| 345 | |
| 346 | def build_patches( |
| 347 | test_parts_set: set[tuple[str, str]], |
| 348 | error_messages: dict[tuple[str, str], str] | None = None, |
| 349 | ) -> dict: |
| 350 | """Convert failing tests to patch format.""" |
| 351 | patches = {} |
| 352 | error_messages = error_messages or {} |
| 353 | for class_name, method_name in sorted(test_parts_set): |
| 354 | if class_name not in patches: |
| 355 | patches[class_name] = {} |
| 356 | reason = error_messages.get((class_name, method_name), "") |
| 357 | patches[class_name][method_name] = [ |
| 358 | PatchSpec(UtMethod.ExpectedFailure, None, reason) |
| 359 | ] |
| 360 | return patches |
| 361 | |
| 362 | |
| 363 | def _is_super_call_only(func_node: ast.FunctionDef | ast.AsyncFunctionDef) -> bool: |
no test coverage detected