Skip to content

Commit 1eec40d

Browse files
committed
Fix more tests
1 parent a17ff9a commit 1eec40d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

openevolve/process_parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _run_iteration_worker(
262262
class ProcessParallelController:
263263
"""Controller for process-based parallel evolution"""
264264

265-
def __init__(self, config: Config, evaluation_file: str, evaluation_object: EvaluationObject, database: ProgramDatabase):
265+
def __init__(self, config: Config, evaluation_file: str, evaluation_object: Optional[EvaluationObject], database: ProgramDatabase):
266266
self.config = config
267267
self.evaluation_file = evaluation_file
268268
self.evaluation_object = evaluation_object

tests/test_process_parallel.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ def tearDown(self):
6464

6565
def test_controller_initialization(self):
6666
"""Test that controller initializes correctly"""
67-
controller = ProcessParallelController(self.config, self.eval_file, self.database)
67+
controller = ProcessParallelController(self.config, self.eval_file, None, self.database)
6868

6969
self.assertEqual(controller.num_workers, 2)
7070
self.assertIsNone(controller.executor)
7171
self.assertIsNotNone(controller.shutdown_event)
7272

7373
def test_controller_start_stop(self):
7474
"""Test starting and stopping the controller"""
75-
controller = ProcessParallelController(self.config, self.eval_file, self.database)
75+
controller = ProcessParallelController(self.config, self.eval_file, None, self.database)
7676

7777
# Start controller
7878
controller.start()
@@ -85,7 +85,7 @@ def test_controller_start_stop(self):
8585

8686
def test_database_snapshot_creation(self):
8787
"""Test creating database snapshot for workers"""
88-
controller = ProcessParallelController(self.config, self.eval_file, self.database)
88+
controller = ProcessParallelController(self.config, self.eval_file, None, self.database)
8989

9090
snapshot = controller._create_database_snapshot()
9191

@@ -106,7 +106,7 @@ def test_run_evolution_basic(self):
106106
"""Test basic evolution run"""
107107

108108
async def run_test():
109-
controller = ProcessParallelController(self.config, self.eval_file, self.database)
109+
controller = ProcessParallelController(self.config, self.eval_file, None, self.database)
110110

111111
# Mock the executor to avoid actually spawning processes
112112
with patch.object(controller, "_submit_iteration") as mock_submit:
@@ -152,7 +152,7 @@ async def run_test():
152152

153153
def test_request_shutdown(self):
154154
"""Test graceful shutdown request"""
155-
controller = ProcessParallelController(self.config, self.eval_file, self.database)
155+
controller = ProcessParallelController(self.config, self.eval_file, None, self.database)
156156

157157
# Request shutdown
158158
controller.request_shutdown()

0 commit comments

Comments
 (0)