@@ -47,6 +47,7 @@ def make_args(**kwargs) -> argparse.Namespace:
4747 loops_per_agent = 1 ,
4848 question_agent_model_name = "gpt-4o" ,
4949 worker_model_name = "gpt-4o" ,
50+ random_loops_per_agent = False ,
5051 model = "gpt-4o" ,
5152 output = None ,
5253 output_dir = None ,
@@ -546,32 +547,6 @@ def test_calls_run_heavy_swarm(self, mock_run):
546547 self .handle_heavy_swarm (args )
547548 mock_run .assert_called_once ()
548549
549- @patch ("swarms.cli.main.HeavySwarm" )
550- def test_run_heavy_swarm_passes_arguments_heavyswarm_accepts (
551- self , mock_swarm
552- ):
553- """Every kwarg the CLI sends must exist on HeavySwarm.__init__.
554-
555- The CLI kept sending loops_per_agent and random_loops_per_agent after
556- both were removed from HeavySwarm, so `swarms heavy-swarm` failed on
557- every invocation with a TypeError that was reported to the user as an
558- API-key or network problem. Mocking run_heavy_swarm, as the test above
559- does, cannot catch that — this binds the real signature.
560- """
561- import inspect
562-
563- from swarms .cli .main import run_heavy_swarm
564- from swarms .structs .heavy_swarm import HeavySwarm
565-
566- run_heavy_swarm (task = "complex analysis" , max_loops = 2 )
567-
568- _ , kwargs = mock_swarm .call_args
569- # Raises TypeError if the CLI passes an argument HeavySwarm dropped.
570- inspect .signature (HeavySwarm .__init__ ).bind (
571- mock_swarm , ** kwargs
572- )
573- assert kwargs ["max_loops" ] == 2
574-
575550
576551# ===========================================================================
577552# 11. CLI utils
0 commit comments