(self, any_kernel: Kernel)
| 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 |
nothing calls this directly
no test coverage detected