From 90a11b6aa80369691eb557532d3ea0564d55d86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 1 Nov 2025 10:23:38 -0700 Subject: [PATCH 1/3] replace pyserial-asyncio with pyserial-asyncio-fast --- tests/test_uart.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) From c063208cf104921638f5a722c11d086e5b475741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 1 Nov 2025 11:02:12 -0700 Subject: [PATCH 2/3] fix CI --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) 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 }} From 873822a508faf11180617158092bb63927c904b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 1 Nov 2025 11:27:05 -0700 Subject: [PATCH 3/3] fix async tests --- tests/test_api.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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"