MCPcopy Index your code
hub / github.com/RustPython/RustPython / build_patches

Function build_patches

scripts/update_lib/cmd_auto_mark.py:346–360  ·  view source on GitHub ↗

Convert failing tests to patch format.

(
    test_parts_set: set[tuple[str, str]],
    error_messages: dict[tuple[str, str], str] | None = None,
)

Source from the content-addressed store, hash-verified

344
345
346def 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
363def _is_super_call_only(func_node: ast.FunctionDef | ast.AsyncFunctionDef) -> bool:

Callers 1

apply_test_changesFunction · 0.85

Calls 3

PatchSpecClass · 0.90
sortedFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected