MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / test_env_pickle_round_trip

Function test_env_pickle_round_trip

tests/test_kernel_extra.py:98–108  ·  view source on GitHub ↗

Sanity check the env_pickle / env_unpickle plumbing — can pickle and reload without raising. We don't compare bit-for-bit semantics, just that the wrapper marshals correctly.

(kernel)

Source from the content-addressed store, hash-verified

96
97
98def test_env_pickle_round_trip(kernel):
99 """Sanity check the env_pickle / env_unpickle plumbing — can pickle
100 and reload without raising. We don't compare bit-for-bit semantics,
101 just that the wrapper marshals correctly."""
102 with tempfile.TemporaryDirectory() as d:
103 path = os.path.join(d, "env.olean")
104 kernel.env_pickle(path)
105 assert os.path.getsize(path) > 0
106 # Reload — env stays loaded even after reload
107 kernel.env_unpickle(path)
108 assert kernel.is_loaded()
109
110
111# ----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

env_pickleMethod · 0.80
env_unpickleMethod · 0.80
is_loadedMethod · 0.80

Tested by

no test coverage detected