MCPcopy
hub / github.com/python/mypy / check_serialization_roundtrip

Function check_serialization_roundtrip

mypyc/test/test_serialization.py:97–106  ·  view source on GitHub ↗

Check that we can serialize modules out and deserialize them to the same thing.

(irs: dict[str, ModuleIR])

Source from the content-addressed store, hash-verified

95
96
97def check_serialization_roundtrip(irs: dict[str, ModuleIR]) -> None:
98 """Check that we can serialize modules out and deserialize them to the same thing."""
99 serialized = {k: ir.serialize() for k, ir in irs.items()}
100
101 ctx = DeserMaps({}, {})
102 irs2 = deserialize_modules(serialized, ctx)
103 assert irs.keys() == irs2.keys()
104
105 for k in irs:
106 assert_modules_same(irs[k], irs2[k])

Callers 1

run_case_stepMethod · 0.90

Calls 6

DeserMapsClass · 0.90
deserialize_modulesFunction · 0.90
assert_modules_sameFunction · 0.85
keysMethod · 0.80
serializeMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…