Skip to content

Commit 2294d7c

Browse files
committed
test: verify non-config errors propagate through query wrapper
1 parent 40641cb commit 2294d7c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

posthog/test/ai/claude_agent_sdk/test_processor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,15 @@ async def test_falls_back_to_original_query_when_posthog_not_configured(self):
607607

608608
assert len(collected) == 1
609609
assert collected[0] is result_msg
610+
611+
@pytest.mark.asyncio
612+
async def test_non_config_errors_propagate(self):
613+
with patch(
614+
"posthog.ai.claude_agent_sdk.PostHogClaudeAgentProcessor",
615+
side_effect=RuntimeError("unexpected init bug"),
616+
):
617+
with pytest.raises(RuntimeError, match="unexpected init bug"):
618+
async for _ in posthog_query(
619+
prompt="Hello", options=ClaudeAgentOptions()
620+
):
621+
pass

0 commit comments

Comments
 (0)