MCPcopy Index your code
hub / github.com/marimo-team/marimo / test_cache_hit

Method test_cache_hit

tests/_save/test_cache.py:550–575  ·  view source on GitHub ↗
(self, any_kernel: Kernel)

Source from the content-addressed store, hash-verified

548 assert k.globals["Z"] == 3
549
550 async def test_cache_hit(self, any_kernel: Kernel) -> None:
551 k = any_kernel
552 await k.run(
553 [
554 ExecuteCellCommand(
555 cell_id="0",
556 code=textwrap.dedent(
557 """
558 from marimo._save.save import persistent_cache
559 from tests._save.loaders.mocks import MockLoader
560
561 with persistent_cache(
562 name="one",
563 _loader=MockLoader(data={"X": 7, "Y": 8}, strict=True)
564 ) as cache:
565 Y = 9
566 X = 10
567 Z = 3
568 """
569 ),
570 ),
571 ]
572 )
573 assert k.globals["X"] == 7
574 assert k.globals["Y"] == 8
575 assert k.globals["Z"] == 3
576
577 async def test_cache_module_hit(self, any_kernel: Kernel) -> None:
578 k = any_kernel

Callers

nothing calls this directly

Calls 2

ExecuteCellCommandClass · 0.90
runMethod · 0.45

Tested by

no test coverage detected