diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b1f0c2..84ac791 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,6 @@ jobs: with: CODE_FOLDER: zigpy_xbee CACHE_VERSION: 2 - PYTHON_VERSION_DEFAULT: 3.9.15 - PRE_COMMIT_CACHE_PATH: ~/.cache/pre-commit MINIMUM_COVERAGE_PERCENTAGE: 100 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/test_api.py b/tests/test_api.py index 48768e1..a366a81 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -323,7 +323,7 @@ def _handle_at_response(api, tsn, status, at_response=b""): return response -def test_handle_at_response_none(api): +async def test_handle_at_response_none(api): """Test AT successful response with no value.""" tsn = 123 fut = _handle_at_response(api, tsn, 0) @@ -332,7 +332,7 @@ def test_handle_at_response_none(api): assert fut.exception() is None -def test_handle_at_response_data(api): +async def test_handle_at_response_data(api): """Test AT successful response with data.""" tsn = 123 status, response = 0, 0x23 @@ -342,7 +342,7 @@ def test_handle_at_response_data(api): assert fut.exception() is None -def test_handle_at_response_error(api): +async def test_handle_at_response_error(api): """Test AT unsuccessful response.""" tsn = 123 status, response = 1, 0x23 @@ -351,7 +351,7 @@ def test_handle_at_response_error(api): assert isinstance(fut.exception(), ATCommandError) -def test_handle_at_response_invalid_command(api): +async def test_handle_at_response_invalid_command(api): """Test invalid AT command response.""" tsn = 123 status, response = 2, 0x23 @@ -360,7 +360,7 @@ def test_handle_at_response_invalid_command(api): assert isinstance(fut.exception(), InvalidCommand) -def test_handle_at_response_undef_error(api): +async def test_handle_at_response_undef_error(api): """Test AT unsuccessful response with undefined error.""" tsn = 123 status, response = 0xEE, 0x23 @@ -482,7 +482,7 @@ def test_handle_tx_status_duplicate(api): assert send_fut.set_exception.call_count == 0 -def test_handle_registration_status(api): +async def test_handle_registration_status(api): """Test device registration status.""" frame_id = 0x12 status = xbee_t.RegistrationStatus.SUCCESS @@ -526,7 +526,7 @@ async def test_command_mode_at_cmd_timeout(api): assert result is None -def test_handle_command_mode_rsp(api): +async def test_handle_command_mode_rsp(api): """Test command mode response.""" api._cmd_mode_future = None data = "OK" diff --git a/tests/test_uart.py b/tests/test_uart.py index a235bd8..fa4739d 100644 --- a/tests/test_uart.py +++ b/tests/test_uart.py @@ -4,7 +4,7 @@ from unittest import mock import pytest -import serial_asyncio +import serial_asyncio_fast import zigpy.config from zigpy_xbee import uart @@ -22,7 +22,7 @@ def gw(): """Gateway fixture.""" gw = uart.Gateway(mock.MagicMock()) gw._transport = mock.MagicMock() - gw._transport.serial.BAUDRATES = serial_asyncio.serial.Serial.BAUDRATES + gw._transport.serial.BAUDRATES = serial_asyncio_fast.serial.Serial.BAUDRATES return gw @@ -48,7 +48,7 @@ async def mock_conn(loop, protocol_factory, **kwargs): loop.call_soon(protocol.connection_made, None) return None, protocol - monkeypatch.setattr(serial_asyncio, "create_serial_connection", mock_conn) + monkeypatch.setattr(serial_asyncio_fast, "create_serial_connection", mock_conn) await uart.connect(DEVICE_CONFIG, api)