File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
services/web/server/tests/unit/with_dbs/01 Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 66# pylint: disable=no-self-argument
77
88from typing import Any
9+ from unittest .mock import Mock
910
1011import pytest
1112from aiohttp .test_utils import TestClient
@@ -77,11 +78,14 @@ async def test_listing_tasks_with_list_inprocess_tasks_error(
7778
7879 class _DummyTaskManager :
7980 def list_tasks (self , * args , ** kwargs ):
80- raise Exception () # pylint: disable=broad-exception-raised
81+ raise Exception # pylint: disable=broad-exception-raised # noqa: TRY002
82+
83+ mock = Mock ()
84+ mock .tasks_manager = _DummyTaskManager ()
8185
8286 mocker .patch (
83- "servicelib.aiohttp.long_running_tasks._routes.get_tasks_manager " ,
84- return_value = _DummyTaskManager () ,
87+ "servicelib.aiohttp.long_running_tasks._routes.get_long_running_manager " ,
88+ return_value = mock ,
8589 )
8690
8791 _async_jobs_listing_path = client .app .router ["get_async_jobs" ].url_for ()
You can’t perform that action at this time.
0 commit comments