Skip to content

Commit d1967b4

Browse files
olivermeyerclaude
andcommitted
test(di): replace discover_plugin_packages mock with entry_points patch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8bc0aeb commit d1967b4

2 files changed

Lines changed: 90 additions & 79 deletions

File tree

tests/AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ def test_service_initialization(mock_client):
6363
mock_client.assert_called_once()
6464
```
6565

66+
> **Critical rule**: `@patch` is only acceptable for **external libraries and stdlib** (e.g.
67+
> `sentry_sdk`, `importlib.metadata.entry_points`, `sys.exit`). Never patch symbols that live
68+
> inside `aignostics_foundry_core` itself — instead set up the real environment so the code runs
69+
> for real (use `set_context()` / `reset_context()`, set `request.app.state`, etc.) and mark
70+
> those tests `@pytest.mark.integration`.
71+
6672
**Run locally**:
6773

6874
```bash

0 commit comments

Comments
 (0)