(self, any_kernel: Kernel)
| 575 | assert k.globals["Z"] == 3 |
| 576 | |
| 577 | async def test_cache_module_hit(self, any_kernel: Kernel) -> None: |
| 578 | k = any_kernel |
| 579 | await k.run( |
| 580 | [ |
| 581 | ExecuteCellCommand( |
| 582 | cell_id="0", |
| 583 | code=textwrap.dedent( |
| 584 | """ |
| 585 | import marimo as mod |
| 586 | from marimo._save.save import persistent_cache |
| 587 | from tests._save.loaders.mocks import MockLoader |
| 588 | |
| 589 | def my_func_2(): |
| 590 | return 2 |
| 591 | |
| 592 | with persistent_cache( |
| 593 | name="one", |
| 594 | _loader=MockLoader(data={"mo": mod}, strict=True), |
| 595 | ) as cache: |
| 596 | import numpy as mo |
| 597 | """ |
| 598 | ), |
| 599 | ), |
| 600 | ] |
| 601 | ) |
| 602 | assert not k.stderr.messages, k.stderr |
| 603 | assert not k.stdout.messages, k.stdout |
| 604 | assert k.globals["mo"].__version__ == marimo.__version__ |
| 605 | |
| 606 | async def test_cache_module_miss(self, any_kernel: Kernel) -> None: |
| 607 | k = any_kernel |
nothing calls this directly
no test coverage detected