Some test files (e.g. test_llm_core_sanitize_tool_calls) stub sqlalchemy and core.database at module level with `if mod not in sys.modules`. During pytest collection these stubs fire before the real modules are imported, contaminating every subsequent test that needs real ORM objects (IntegrityError, missing columns, etc.). Pre-import the real modules in conftest.py so the module-level guards find them already loaded and skip the stubs. Fixes ~10+ cascading test failures that only appear in the full suite. Fixes #2395 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.9 KiB
1.9 KiB