Skip to content

Commit 42c232a

Browse files
author
opspawn
committed
test: add coverage for invalid env var value in recursion_limit
Address Copilot review feedback: add test verifying that a non-numeric LANGGRAPH_RECURSION_LIMIT env var raises an error at config creation. Signed-off-by: OpSpawn Agent <agent@opspawn.com> Signed-off-by: opspawn <opspawn@users.noreply.github.com>
1 parent bef63d3 commit 42c232a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

python/packages/kagent-langgraph/tests/test_executor_config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,12 @@ def test_recursion_limit_rejects_negative():
4646

4747
with pytest.raises(Exception):
4848
LangGraphAgentExecutorConfig(recursion_limit=-5)
49+
50+
51+
def test_recursion_limit_invalid_env_var():
52+
"""Test that a non-numeric LANGGRAPH_RECURSION_LIMIT env var raises an error."""
53+
import kagent.langgraph._executor as executor_mod
54+
55+
with patch.dict(os.environ, {"LANGGRAPH_RECURSION_LIMIT": "abc"}):
56+
with pytest.raises((ValueError, Exception)):
57+
executor_mod.LangGraphAgentExecutorConfig()

0 commit comments

Comments
 (0)