Skip to content

Commit

Permalink
Fix all slow unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Jul 24, 2024
1 parent ca548c6 commit 8b3cd6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ async def test_send_packet_unicast_source_route(make_app, packet):
)


@patch("bellows.zigbee.application.RETRY_DELAYS", [0.01, 0.01, 0.01])
async def test_send_packet_unicast_retries_success(app, packet):
await _test_send_packet_unicast(
app,
Expand All @@ -861,6 +862,7 @@ async def test_send_packet_unicast_unexpected_failure(app, packet):
)


@patch("bellows.zigbee.application.RETRY_DELAYS", [0.01, 0.01, 0.01])
async def test_send_packet_unicast_retries_failure(app, packet):
with pytest.raises(zigpy.exceptions.DeliveryError):
await _test_send_packet_unicast(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ async def test_ash_protocol_startup(caplog):
]


@patch("bellows.ash.T_RX_ACK_INIT", ash.T_RX_ACK_INIT / 100)
@patch("bellows.ash.T_RX_ACK_MIN", ash.T_RX_ACK_MIN / 100)
@patch("bellows.ash.T_RX_ACK_MAX", ash.T_RX_ACK_MAX / 100)
@patch("bellows.ash.T_RX_ACK_INIT", ash.T_RX_ACK_INIT / 1000)
@patch("bellows.ash.T_RX_ACK_MIN", ash.T_RX_ACK_MIN / 1000)
@patch("bellows.ash.T_RX_ACK_MAX", ash.T_RX_ACK_MAX / 1000)
@pytest.mark.parametrize(
"transport_cls",
[
Expand Down
1 change: 1 addition & 0 deletions tests/test_ezsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ async def test_form_network_fail(ezsp_f):
await _test_form_network(ezsp_f, [t.EmberStatus.FAILURE], b"\x90")


@patch("bellows.ezsp.NETWORK_OPS_TIMEOUT", 0.1)
async def test_form_network_fail_stack_status(ezsp_f):
with pytest.raises(Exception):
await _test_form_network(ezsp_f, [t.EmberStatus.SUCCESS], b"\x00")
Expand Down

0 comments on commit 8b3cd6b

Please sign in to comment.