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

@@ -7,7 +7,7 @@ import inspect
import pkgutil
import sys
from contextlib import AbstractContextManager
from unittest.mock import Mock, patch
from unittest.mock import AsyncMock, patch
import pytest
@@ -85,7 +85,7 @@ async def test_create_device_with_timeout():
async def test_create_thin_wrapper():
"""Make sure thin wrapper is created with the correct device type."""
mock = Mock()
mock = AsyncMock()
config = DeviceConfig(
host="test_host",
port_override=1234,
@@ -281,7 +281,7 @@ async def test_device_type_aliases():
"""Test that the device type aliases in Device work."""
def _mock_connect(config, *args, **kwargs):
mock = Mock()
mock = AsyncMock()
mock.config = config
return mock