Skip to content

Commit 5fa9410

Browse files
committed
test(extractor): also patch make_batch_provider in mock factory
LLMExtractor.__init__ also calls make_batch_provider eagerly, which hits the same OpenAI() credential check. Local runs pass because dotenv loads OPENAI_API_KEY at import; CI without an .env failed.
1 parent 65ec7e4 commit 5fa9410

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tests/extraction/llm/test_extractor.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ def _make_mock_extractor(
4040
"""
4141
cfg = ExtractorConfig(model=model, run_dir=run_dir, debug=debug)
4242
provider = MagicMock(retryable_exceptions=(ConnectionError,))
43-
with patch(
44-
"explainshell.extraction.llm.extractor.make_provider",
45-
return_value=provider,
43+
with (
44+
patch(
45+
"explainshell.extraction.llm.extractor.make_provider",
46+
return_value=provider,
47+
),
48+
patch(
49+
"explainshell.extraction.llm.extractor.make_batch_provider",
50+
return_value=MagicMock(),
51+
),
4652
):
4753
return LLMExtractor(cfg)
4854

0 commit comments

Comments
 (0)