Skip to content

Commit 68ae281

Browse files
committed
aioble/multitests: Store a reference to return value of create_task.
As required by CPython, and enforced by Ruff RUF006. Signed-off-by: Damien George <[email protected]>
1 parent 4063dac commit 68ae281

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

micropython/bluetooth/aioble/multitests/ble_write_order.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ async def instance0_task():
4444

4545
# Register characteristic.written() handlers as asyncio background tasks.
4646
# The order of these is important!
47-
asyncio.create_task(task_written(characteristic_second, "second"))
48-
asyncio.create_task(task_written(characteristic_first, "first"))
47+
task_second = asyncio.create_task(task_written(characteristic_second, "second"))
48+
task_first = asyncio.create_task(task_written(characteristic_first, "first"))
4949

5050
# This dummy task simulates background processing on a real system that
5151
# can block the asyncio loop for brief periods of time
52-
asyncio.create_task(task_dummy())
52+
task_dummy = asyncio.create_task(task_dummy())
5353

5454
multitest.globals(BDADDR=aioble.config("mac"))
5555
multitest.next()

0 commit comments

Comments
 (0)