Reset the module-level caches so each test starts clean.
()
| 30 | |
| 31 | @pytest.fixture(autouse=True) |
| 32 | def _clear_exec_caches(): |
| 33 | """Reset the module-level caches so each test starts clean.""" |
| 34 | from reflex_docs.docgen_pipeline import _executed_blocks, _file_modules |
| 35 | |
| 36 | old_blocks = _executed_blocks.copy() |
| 37 | old_modules = _file_modules.copy() |
| 38 | _executed_blocks.clear() |
| 39 | _file_modules.clear() |
| 40 | yield |
| 41 | _executed_blocks.clear() |
| 42 | _executed_blocks.update(old_blocks) |
| 43 | _file_modules.clear() |
| 44 | _file_modules.update(old_modules) |
| 45 | |
| 46 | |
| 47 | def _render_once(text: str, virtual_filepath: str = "test_double_eval.md"): |