@@ -112,55 +112,55 @@ def test_agent_memoization():
112112 first_call_result = crew .simple_agent ()
113113 second_call_result = crew .simple_agent ()
114114
115- assert (
116- first_call_result is second_call_result
117- ), "Agent memoization is not working as expected"
115+ assert first_call_result is second_call_result , (
116+ "Agent memoization is not working as expected"
117+ )
118118
119119
120120def test_task_memoization ():
121121 crew = SimpleCrew ()
122122 first_call_result = crew .simple_task ()
123123 second_call_result = crew .simple_task ()
124124
125- assert (
126- first_call_result is second_call_result
127- ), "Task memoization is not working as expected"
125+ assert first_call_result is second_call_result , (
126+ "Task memoization is not working as expected"
127+ )
128128
129129
130130def test_crew_memoization ():
131131 crew = InternalCrew ()
132132 first_call_result = crew .crew ()
133133 second_call_result = crew .crew ()
134134
135- assert (
136- first_call_result is second_call_result
137- ), "Crew references should point to the same object"
135+ assert first_call_result is second_call_result , (
136+ "Crew references should point to the same object"
137+ )
138138
139139
140140def test_task_name ():
141141 simple_task = SimpleCrew ().simple_task ()
142- assert (
143- simple_task . name == "simple_task "
144- ), "Task name is not inferred from function name as expected"
142+ assert simple_task . name == "simple_task" , (
143+ "Task name is not inferred from function name as expected "
144+ )
145145
146146 custom_named_task = SimpleCrew ().custom_named_task ()
147- assert (
148- custom_named_task . name == "Custom "
149- ), "Custom task name is not being set as expected"
147+ assert custom_named_task . name == "Custom" , (
148+ "Custom task name is not being set as expected "
149+ )
150150
151151
152152def test_agent_function_calling_llm ():
153153 crew = InternalCrew ()
154154 llm = crew .local_llm ()
155155 obj_llm_agent = crew .researcher ()
156- assert (
157- obj_llm_agent . function_calling_llm is llm
158- ), "agent's function_calling_llm is incorrect"
156+ assert obj_llm_agent . function_calling_llm is llm , (
157+ "agent's function_calling_llm is incorrect"
158+ )
159159
160160 str_llm_agent = crew .reporting_analyst ()
161- assert (
162- str_llm_agent . function_calling_llm . model == "online_llm "
163- ), "agent's function_calling_llm is incorrect"
161+ assert str_llm_agent . function_calling_llm . model == "online_llm" , (
162+ "agent's function_calling_llm is incorrect "
163+ )
164164
165165
166166def test_task_guardrail ():
@@ -186,9 +186,9 @@ def test_after_kickoff_modification():
186186 # Assuming the crew execution returns a dict
187187 result = crew .crew ().kickoff ({"topic" : "LLMs" })
188188
189- assert (
190- "post processed" in result . raw
191- ), "After kickoff function did not modify outputs"
189+ assert "post processed" in result . raw , (
190+ "After kickoff function did not modify outputs"
191+ )
192192
193193
194194@pytest .mark .vcr (filter_headers = ["authorization" ])
@@ -274,10 +274,8 @@ def another_simple_tool():
274274
275275
276276def test_internal_crew_with_mcp ():
277- # Mock embedchain initialization to prevent race conditions in parallel CI execution
278- with patch ("embedchain.client.Client.setup" ):
279- from crewai_tools import MCPServerAdapter
280- from crewai_tools .adapters .mcp_adapter import ToolCollection
277+ from crewai_tools import MCPServerAdapter
278+ from crewai_tools .adapters .mcp_adapter import ToolCollection
281279
282280 mock = Mock (spec = MCPServerAdapter )
283281 mock .tools = ToolCollection ([simple_tool , another_simple_tool ])
@@ -287,6 +285,5 @@ def test_internal_crew_with_mcp():
287285 assert crew .researcher ().tools == [simple_tool ]
288286
289287 adapter_mock .assert_called_once_with (
290- {"host" : "localhost" , "port" : 8000 },
291- connect_timeout = 120
288+ {"host" : "localhost" , "port" : 8000 }, connect_timeout = 120
292289 )
0 commit comments