Enhance run_crew.py with improved logging, error handling, and tests

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-03-12 13:39:49 +00:00
parent a7d7edb983
commit d4480bc694
3 changed files with 142 additions and 3 deletions

View File

@@ -10,7 +10,14 @@ from crewai.cli.run_crew import CrewType, execute_command
def test_execute_command_adds_src_to_path():
"""Test that execute_command adds the src directory to sys.path."""
"""
Test that execute_command correctly modifies sys.path.
Ensures:
1. src directory is added to sys.path when it exists.
2. Original sys.path is preserved for other entries.
3. Command execution proceeds correctly.
"""
# Create a temporary directory with a src subdirectory
with tempfile.TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)