Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/utilities/aiotasks/test_coro_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ async def f(mock):
return mock()


def factory(loop, coro_or_mock, context=None):
# Kwargs are accepted to match the signatures, but are unused/not passed through due to no need.
# Usually those are `name` & `context`, as in `asyncio.create_task(…)`.
def factory(loop, coro_or_mock, **_):
coro = coro_or_mock._mock_wraps if isinstance(coro_or_mock, AsyncMock) else coro_or_mock
return asyncio.Task(coro, loop=loop)

Expand Down
Loading