Skip to content

Commit ed4de99

Browse files
committed
Replace all per-test timeouts with a global 10s timeout
1 parent 99f7de6 commit ed4de99

17 files changed

+16
-25
lines changed

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ combine_as_imports = true
3030

3131
[tool:pytest]
3232
addopts = --showlocals --verbose
33-
testpaths = tests
33+
testpaths = tests
34+
timeout=10

tests/api/test_connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from ..conftest import FAKE_SERIAL_PORT, BaseServerZNP, config_for_port_path
88

9-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
9+
pytestmark = [pytest.mark.asyncio]
1010

1111

1212
async def test_connect_no_communication(connected_znp):

tests/api/test_listeners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import zigpy_znp.commands as c
88
from zigpy_znp.api import OneShotResponseListener, CallbackResponseListener
99

10-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
10+
pytestmark = [pytest.mark.asyncio]
1111

1212

1313
async def test_resolve(event_loop, mocker):

tests/api/test_nvram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import zigpy_znp.commands as c
55
from zigpy_znp.types import nvids
66

7-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
7+
pytestmark = [pytest.mark.asyncio]
88

99

1010
async def test_wrong_order(connected_znp, event_loop):

tests/api/test_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import zigpy_znp.commands as c
99
from zigpy_znp.exceptions import CommandNotRecognized, InvalidCommandResponse
1010

11-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
11+
pytestmark = [pytest.mark.asyncio]
1212

1313

1414
async def test_callback_rsp(connected_znp, event_loop):

tests/api/test_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import zigpy_znp.commands as c
88
from zigpy_znp.api import _deduplicate_commands
99

10-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
10+
pytestmark = [pytest.mark.asyncio]
1111

1212

1313
async def test_responses(connected_znp):

tests/application/test_connect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from ..conftest import FORMED_DEVICES, FormedLaunchpadCC26X2R1, swap_attribute
1010

11-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
11+
pytestmark = [pytest.mark.asyncio]
1212

1313

1414
@pytest.mark.xfail(raises=AssertionError)
@@ -81,7 +81,6 @@ async def test_probe_multiple(device, make_znp_server):
8181
assert await ControllerApplication.probe(config)
8282

8383

84-
@pytest.mark.timeout(5)
8584
@pytest.mark.parametrize("device", FORMED_DEVICES)
8685
async def test_reconnect(device, event_loop, make_application):
8786
app, znp_server = make_application(

tests/application/test_joining.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ..conftest import FORMED_DEVICES, FORMED_ZSTACK3_DEVICES
1414

15-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
15+
pytestmark = [pytest.mark.asyncio]
1616

1717

1818
@pytest.mark.parametrize("device", FORMED_DEVICES)
@@ -79,7 +79,6 @@ async def test_permit_join_failure(device, make_application):
7979
await app.shutdown()
8080

8181

82-
@pytest.mark.timeout(2)
8382
@pytest.mark.parametrize("device", FORMED_ZSTACK3_DEVICES)
8483
@pytest.mark.parametrize("status", [t.Status.SUCCESS, t.Status.MAC_MEM_ERROR])
8584
async def test_permit_join_with_key(device, status, make_application):

tests/application/test_requests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from ..conftest import FORMED_DEVICES, CoroutineMock
1212

13-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
13+
pytestmark = [pytest.mark.asyncio]
1414

1515

1616
@pytest.mark.parametrize("device", FORMED_DEVICES)
@@ -263,7 +263,6 @@ async def test_mrequest(device, make_application, mocker):
263263

264264

265265
@pytest.mark.parametrize("device", FORMED_DEVICES)
266-
@pytest.mark.timeout(10)
267266
async def test_request_concurrency(device, make_application, mocker):
268267
app, znp_server = make_application(
269268
server_cls=device, client_config={conf.CONF_MAX_CONCURRENT_REQUESTS: 2}

tests/application/test_startup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
FormedLaunchpadCC26X2R1,
1717
)
1818

19-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
19+
pytestmark = [pytest.mark.asyncio]
2020

2121

2222
@pytest.mark.parametrize(

tests/application/test_update_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from ..conftest import FORMED_DEVICES, CoroutineMock
77

8-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
8+
pytestmark = [pytest.mark.asyncio]
99

1010

1111
@pytest.mark.parametrize("device", FORMED_DEVICES)

tests/application/test_zigpy_callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from ..conftest import FORMED_DEVICES
1010

11-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
11+
pytestmark = [pytest.mark.asyncio]
1212

1313

1414
@pytest.mark.parametrize("device", FORMED_DEVICES)

tests/test_uart.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ def test_uart_frame_received_error(connected_uart, mocker):
221221
znp.frame_received.call_count == 3
222222

223223

224-
@pytest.mark.timeout(1)
225224
@pytest.mark.asyncio
226225
async def test_connect_auto(dummy_serial_conn, mocker):
227226
device, _ = dummy_serial_conn
@@ -234,7 +233,6 @@ async def test_connect_auto(dummy_serial_conn, mocker):
234233
)
235234

236235

237-
@pytest.mark.timeout(1)
238236
@pytest.mark.asyncio
239237
async def test_connection_lost(dummy_serial_conn, mocker, event_loop):
240238
device, _ = dummy_serial_conn
@@ -266,7 +264,6 @@ async def test_connection_lost(dummy_serial_conn, mocker, event_loop):
266264
assert (await conn_closed_fut) is None
267265

268266

269-
@pytest.mark.timeout(1)
270267
@pytest.mark.asyncio
271268
async def test_connection_made(dummy_serial_conn, mocker):
272269
device, _ = dummy_serial_conn
@@ -279,7 +276,6 @@ async def test_connection_made(dummy_serial_conn, mocker):
279276
znp.connection_made.assert_called_once_with()
280277

281278

282-
@pytest.mark.timeout(1)
283279
@pytest.mark.asyncio
284280
async def test_no_toggle_rts(dummy_serial_conn, mocker):
285281
device, serial = dummy_serial_conn
@@ -297,7 +293,6 @@ async def test_no_toggle_rts(dummy_serial_conn, mocker):
297293
assert rts.mock_calls == []
298294

299295

300-
@pytest.mark.timeout(1)
301296
@pytest.mark.asyncio
302297
async def test_toggle_rts(dummy_serial_conn, mocker):
303298
device, serial = dummy_serial_conn

tests/tools/test_energy_scan.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def channel_list(channels):
1919
assert channel_list(t.Channels.CHANNEL_15) == [15]
2020

2121

22-
@pytest.mark.timeout(1)
2322
@pytest.mark.asyncio
2423
@pytest.mark.parametrize("device", FORMED_DEVICES)
2524
async def test_energy_scan(device, make_znp_server, capsys):

tests/tools/test_flash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from ..conftest import BaseServerZNP, CoroutineMock
1111

12-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
12+
pytestmark = [pytest.mark.asyncio]
1313

1414

1515
random.seed(12345)

tests/tools/test_network_scan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from ..conftest import FormedLaunchpadCC26X2R1
1010

11-
pytestmark = [pytest.mark.timeout(1), pytest.mark.asyncio]
11+
pytestmark = [pytest.mark.asyncio]
1212

1313

1414
@pytest.mark.parametrize("device", [FormedLaunchpadCC26X2R1])

tests/tools/test_nvram.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from ..conftest import ALL_DEVICES
1313

14-
pytestmark = [pytest.mark.timeout(3), pytest.mark.asyncio]
14+
pytestmark = [pytest.mark.asyncio]
1515

1616

1717
def not_recognized(req):
@@ -54,7 +54,6 @@ async def test_nvram_read(device, make_znp_server, tmp_path, mocker):
5454
znp_server.close()
5555

5656

57-
@pytest.mark.timeout(5)
5857
@pytest.mark.parametrize("device", ALL_DEVICES)
5958
async def test_nvram_write(device, make_znp_server, tmp_path, mocker):
6059
znp_server = make_znp_server(server_cls=device)

0 commit comments

Comments
 (0)