fix(api-tests): use asyncio run in cs1 tests
This commit is contained in:
@@ -104,9 +104,7 @@ def _run_cs1_block(
|
||||
|
||||
_cs1_auto_approval = MagicMock()
|
||||
_cs1_executor = ApprovalExecutionService()
|
||||
asyncio.get_event_loop().run_until_complete(
|
||||
_cs1_executor.execute_approved_action(_cs1_auto_approval)
|
||||
)
|
||||
asyncio.run(_cs1_executor.execute_approved_action(_cs1_auto_approval))
|
||||
|
||||
return mock_executor_cls, mock_exec_instance
|
||||
|
||||
@@ -217,7 +215,7 @@ class TestCS1AutoExecuteFailureDegradation:
|
||||
except Exception:
|
||||
pass # 降級:維持 PENDING
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(_simulate())
|
||||
asyncio.run(_simulate())
|
||||
except Exception:
|
||||
raised = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user