Python: Remove warnings from workflow builder on not using factories (#2808)

* Revert concurrent

* Fix comments
This commit is contained in:
Tao Chen
2025-12-11 23:56:16 -08:00
committed by GitHub
Unverified
parent e008144187
commit e0ff153ee9
5 changed files with 95 additions and 106 deletions
@@ -63,7 +63,7 @@ def test_concurrent_builder_rejects_duplicate_executors_from_factories() -> None
return _FakeAgentExec("dup", "B") # same executor id
builder = ConcurrentBuilder().register_participants([create_dup1, create_dup2])
with pytest.raises(ValueError, match="Executor with ID 'dup' has already been created."):
with pytest.raises(ValueError, match="Duplicate executor ID 'dup' detected in workflow."):
builder.build()
@@ -497,7 +497,13 @@ def test_mixing_eager_and_lazy_initialization_error():
builder.register_executor(lambda: MockExecutor(id="Lazy"), name="Lazy")
# Mixing eager and lazy should raise an error during add_edge
with pytest.raises(ValueError, match="Both source and target must be either names"):
with pytest.raises(
ValueError,
match=(
r"Both source and target must be either registered factory names \(str\) "
r"or Executor/AgentProtocol instances\."
),
):
builder.add_edge(eager_executor, "Lazy")