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

Method test_cache_function_miss

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

Source from the content-addressed store, hash-verified

658 assert k.globals["my_func"]() == 2
659
660 async def test_cache_function_miss(self, any_kernel: Kernel) -> None:
661 k = any_kernel
662 await k.run(
663 [
664 ExecuteCellCommand(
665 cell_id="0",
666 code=textwrap.dedent(
667 """
668 from marimo._save.save import persistent_cache
669 from tests._save.loaders.mocks import MockLoader
670
671 with persistent_cache(
672 name="one", _loader=MockLoader(),
673 ) as cache:
674 def my_func():
675 return 1
676 """
677 ),
678 ),
679 ]
680 )
681 # No warning messages.
682 assert not k.stdout.messages, k.stdout
683 assert not k.stderr.messages, k.stderr
684 assert k.globals["my_func"]() == 1
685
686 async def test_cache_ui_hit(self, any_kernel: Kernel) -> None:
687 k = any_kernel

Callers

nothing calls this directly

Calls 2

ExecuteCellCommandClass · 0.90
runMethod · 0.45

Tested by

no test coverage detected