Remove async magic patch from tests (#1146)

Not required since AsyncMock available in python 3.8 and probably better
to keep magic to a minimum.
This commit is contained in:
Steven B.
2024-10-02 16:12:10 +01:00
committed by GitHub
parent 1026e890a1
commit 8bb2cca7cf
4 changed files with 19 additions and 18 deletions

View File

@@ -140,14 +140,3 @@ def mock_datagram_endpoint(request): # noqa: PT004
side_effect=_create_datagram_endpoint,
):
yield
# allow mocks to be awaited
# https://stackoverflow.com/questions/51394411/python-object-magicmock-cant-be-used-in-await-expression/51399767#51399767
async def async_magic():
pass
MagicMock.__await__ = lambda x: async_magic().__await__()