From 5ccdfdb1d32f103666195ed6e5d04ca9feda5065 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 15:51:17 +0000 Subject: [PATCH] Fix lint errors: remove unused variable and add raw string prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unused 'crew' variable in test_hierarchical_crew_does_not_propagate_agent_tools_to_manager (F841) - Add raw string prefixes to regex patterns to comply with RUF043 linting rule - Pre-existing RUF043 errors in changed files were blocking PR, so fixed them Co-Authored-By: João --- tests/test_crew.py | 8 ++++---- tests/test_task.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_crew.py b/tests/test_crew.py index 26a434967..661062dbb 100644 --- a/tests/test_crew.py +++ b/tests/test_crew.py @@ -200,7 +200,7 @@ def test_async_task_cannot_include_sequential_async_tasks_in_context( # This should raise an error because task2 is async and has task1 in its context without a sync task in between with pytest.raises( ValueError, - match="Task 'Task 2' is asynchronous and cannot include other sequential asynchronous tasks in its context.", + match=r"Task 'Task 2' is asynchronous and cannot include other sequential asynchronous tasks in its context.", ): Crew(tasks=[task1, task2, task3, task4, task5], agents=[researcher, writer]) @@ -238,7 +238,7 @@ def test_context_no_future_tasks(researcher, writer): # This should raise an error because task1 has a context dependency on a future task (task4) with pytest.raises( ValueError, - match="Task 'Task 1' has a context dependency on a future task 'Task 4', which is not allowed.", + match=r"Task 'Task 1' has a context dependency on a future task 'Task 4', which is not allowed.", ): Crew(tasks=[task1, task2, task3, task4], agents=[researcher, writer]) @@ -3339,7 +3339,7 @@ def test_replay_with_invalid_task_id(): ): with pytest.raises( ValueError, - match="Task with id bf5b09c9-69bd-4eb8-be12-f9e5bae31c2d not found in the crew's tasks.", + match=r"Task with id bf5b09c9-69bd-4eb8-be12-f9e5bae31c2d not found in the crew's tasks.", ): crew.replay("bf5b09c9-69bd-4eb8-be12-f9e5bae31c2d") @@ -3842,7 +3842,7 @@ def test_hierarchical_crew_does_not_propagate_agent_tools_to_manager(): agent=agent_with_tools, ) - crew = Crew( + Crew( agents=[agent_with_tools], tasks=[task], process=Process.hierarchical, diff --git a/tests/test_task.py b/tests/test_task.py index 7ab87e99d..5fff55713 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -1222,7 +1222,7 @@ def test_create_directory_false(): assert not resolved_dir.exists() with pytest.raises( - RuntimeError, match="Directory .* does not exist and create_directory is False" + RuntimeError, match=r"Directory .* does not exist and create_directory is False" ): task._save_file("test content")