Skip to content

Commit 4770a93

Browse files
authored
Merge pull request #152 from SaptaDey/codex/fix-test-failures-due-to-assertion-mismatches
Fix tests and adjust stubs
2 parents 27ac84c + 854e585 commit 4770a93

File tree

7 files changed

+89
-56
lines changed

7 files changed

+89
-56
lines changed

src/adaptive_graph_of_thoughts/app_setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ async def setup_post(
270270
return RedirectResponse("/setup/settings", status_code=303)
271271

272272
yaml_path = Path(__file__).resolve().parents[2] / "config" / "settings.yaml"
273-
original_settings = yaml.safe_load(yaml_path.read_text()) or {}
273+
try:
274+
original_settings = yaml.safe_load(yaml_path.read_text()) or {}
275+
logger.error(f"Failed to load YAML settings from {yaml_path}: {exc}")
276+
logger.error(f"Failed to load YAML settings: {exc}")
277+
original_settings = {}
274278

275279
def _read_settings() -> dict[str, str]:
276280
"""
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Compatibility wrapper for GoTProcessor import path used in tests."""
2+
from ...application.got_processor import GoTProcessor
3+
4+
__all__ = ["GoTProcessor"]

src/mcp/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
"""Pytest configuration for the test suite."""
2+
13
import pytest
24

3-
def pytest_configure(config):
4-
pytest.exit("Tests disabled")
5+
6+
def pytest_configure(config: pytest.Config) -> None:
7+
"""Hook for configuring pytest during initialization."""
8+
# No-op configuration hook. Originally this exited early to disable tests
9+
# when the repository was used without its optional dependencies. The test
10+
# suite now runs by default, so we simply return to allow normal execution.
11+
return

tests/integration/stages/test_integration_initialization_stage.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def stub_modules(monkeypatch: pytest.MonkeyPatch) -> Generator[None, None, None]
4141
stub_config.runtime_settings = types.SimpleNamespace(
4242
neo4j=types.SimpleNamespace(uri="bolt://localhost", user="neo4j", password="test", database="neo4j")
4343
)
44+
stub_config.LegacyConfig = DummySettings
45+
stub_config.Config = DummySettings
46+
stub_config.ExaSearchConfig = DummySettings
47+
stub_config.GoogleScholarConfig = DummySettings
48+
stub_config.PubMedConfig = DummySettings
4449
monkeypatch.setitem(sys.modules, "adaptive_graph_of_thoughts.config", stub_config)
4550
monkeypatch.setitem(sys.modules, "src.adaptive_graph_of_thoughts.config", stub_config)
4651

0 commit comments

Comments
 (0)