()
| 373 | |
| 374 | @pytest.fixture(scope="function", autouse=True) |
| 375 | def reset_plugins(): |
| 376 | from aura.analyzers.python.readonly import ReadOnlyAnalyzer |
| 377 | from aura import plugins |
| 378 | |
| 379 | read_only_hooks = ReadOnlyAnalyzer.hooks |
| 380 | cache = plugins.PLUGIN_CACHE.copy() |
| 381 | |
| 382 | try: |
| 383 | ReadOnlyAnalyzer.hooks = [] |
| 384 | plugins.PLUGIN_CACHE = {"analyzers": {}} |
| 385 | yield |
| 386 | finally: |
| 387 | ReadOnlyAnalyzer.hooks = read_only_hooks |
| 388 | plugins.PLUGIN_CACHE = cache |
| 389 | |
| 390 | |
| 391 | @pytest.fixture(scope="module") |