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)
| 96 | |
| 97 | |
| 98 | def 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 | # ---------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected