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