Skip to content

Commit 8b47b64

Browse files
authored
Merge branch 'fix-test-triage-and-issues-4039835176754165263' into copilot/sub-pr-207
Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
2 parents c7b0300 + 7d490b8 commit 8b47b64

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

tests/integration/test_config_validation_flow.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,14 @@
3434

3535
@pytest.fixture(autouse=True)
3636
def setup_test_container(test_settings):
37-
"""Override DI-injected settings for services resolved through the container.
38-
39-
Uses ``container.use_overrides`` so that pre-existing overrides are
40-
snapshot-restored automatically on teardown without touching private state.
41-
42-
Note: ``codeweaver.core.get_settings()`` constructs settings directly from
43-
the installed package configuration and does *not* consult this container,
44-
so this override only affects services that receive their settings via DI
45-
resolution. Code paths that call ``get_settings()`` directly (e.g.
46-
``CheckpointManager._extract_fingerprint``) must be patched separately.
47-
"""
48-
from codeweaver.core.config.settings_type import CodeWeaverSettingsType
37+
"""Create test DI container and override settings so real `get_settings()` works."""
4938
from codeweaver.core.di.container import get_container
50-
39+
from codeweaver.core.config.settings_type import CodeWeaverSettingsType
5140

5241
container = get_container()
53-
with container.use_overrides({CodeWeaverSettingsType: test_settings}):
54-
yield container
42+
container.override(CodeWeaverSettingsType, test_settings)
43+
yield container
44+
container.clear()
5545

5646

5747
@pytest.fixture
@@ -218,13 +208,9 @@ def mock_vector_store() -> AsyncMock:
218208

219209

220210
@pytest.fixture
221-
def test_settings() -> NonCallableMock:
222-
"""Create test Settings with default configuration.
223-
224-
Uses ``NonCallableMock`` so the DI container does not invoke the object as
225-
a factory when resolving ``CodeWeaverSettingsType``.
226-
"""
227-
settings = NonCallableMock()
211+
def test_settings() -> Mock:
212+
"""Create test Settings with default configuration."""
213+
settings = Mock()
228214

229215
# Provider settings
230216
settings.provider = Mock()

0 commit comments

Comments
 (0)