test(crewai): update mirrored CLI test after run_crew input refactor

lib/crewai/tests/cli/test_run_crew.py imports crewai_cli internals and is
collected by the lib/crewai test job (Run Tests). It still imported
_prompt_for_missing_inputs, which was replaced by _resolve_crew_inputs, so
the module failed to import — erroring pytest at collection and cancelling
the rest of the matrix via fail-fast.

Point it at _resolve_crew_inputs and patch the prompt in the shared
crewai_cli.input_prompt module where prompting now lives.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RBYGqJHC2TMC6fonFziuuh
This commit is contained in:
Joao Moura
2026-07-07 13:05:12 -07:00
parent 1eb4bf8b3c
commit 592d27f808

View File

@@ -14,7 +14,7 @@ from crewai_cli.run_crew import (
_execute_uv_script,
_load_json_crew_for_tui,
_missing_input_names,
_prompt_for_missing_inputs,
_resolve_crew_inputs,
)
@@ -105,7 +105,7 @@ def test_missing_input_names_scans_agent_and_task_placeholders() -> None:
]
def test_prompt_for_missing_inputs_merges_runtime_values(monkeypatch) -> None:
def test_resolve_crew_inputs_merges_runtime_values(monkeypatch) -> None:
crew = SimpleNamespace(
agents=[SimpleNamespace(role="Researcher", goal="Cover {topic}", backstory="")],
tasks=[
@@ -123,9 +123,10 @@ def test_prompt_for_missing_inputs_merges_runtime_values(monkeypatch) -> None:
return values["audience"]
raise AssertionError(f"Unexpected prompt: {label}")
monkeypatch.setattr("crewai_cli.run_crew.click.prompt", prompt)
# Prompting now lives in the shared crewai_cli.input_prompt helper.
monkeypatch.setattr("crewai_cli.input_prompt.click.prompt", prompt)
assert _prompt_for_missing_inputs(crew, {"topic": "AI"}) == {
assert _resolve_crew_inputs(crew, {"topic": "AI"}, None, interactive=True) == {
"topic": "AI",
"audience": "developers",
}