Skip to content

Commit 1810edf

Browse files
authored
fix: override workflow_executor property in MockInferenceEngine (#682)
The base class InferenceEngine defines workflow_executor as a read-only property without a setter. Override it with a proper getter/setter pair to allow setting the mock workflow executor in tests.
1 parent b07d017 commit 1810edf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

areal/tests/test_engine_api_workflow_resolution.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ class MockInferenceEngine(InferenceEngine):
3737
"""Mock inference engine for testing workflow resolution"""
3838

3939
def __init__(self):
40-
self.workflow_executor = Mock()
41-
self.workflow_executor.submit = Mock()
42-
self.workflow_executor.rollout_batch = Mock(return_value={"result": "batch"})
43-
self.workflow_executor.prepare_batch = Mock(return_value={"result": "prepared"})
40+
self._workflow_executor = Mock()
41+
self._workflow_executor.submit = Mock()
42+
self._workflow_executor.rollout_batch = Mock(return_value={"result": "batch"})
43+
self._workflow_executor.prepare_batch = Mock(
44+
return_value={"result": "prepared"}
45+
)
46+
47+
@property
48+
def workflow_executor(self):
49+
return self._workflow_executor
4450

4551
def submit(
4652
self,

0 commit comments

Comments
 (0)