Skip to content

Commit

Permalink
aioble/multitests: Store a reference to return value of create_task.
Browse files Browse the repository at this point in the history
As required by CPython, and enforced by Ruff RUF006.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Jun 12, 2024
1 parent 4063dac commit 68ae281
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions micropython/bluetooth/aioble/multitests/ble_write_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ async def instance0_task():

# Register characteristic.written() handlers as asyncio background tasks.
# The order of these is important!
asyncio.create_task(task_written(characteristic_second, "second"))
asyncio.create_task(task_written(characteristic_first, "first"))
task_second = asyncio.create_task(task_written(characteristic_second, "second"))

Check failure on line 47 in micropython/bluetooth/aioble/multitests/ble_write_order.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F841)

micropython/bluetooth/aioble/multitests/ble_write_order.py:47:5: F841 Local variable `task_second` is assigned to but never used
task_first = asyncio.create_task(task_written(characteristic_first, "first"))

Check failure on line 48 in micropython/bluetooth/aioble/multitests/ble_write_order.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F841)

micropython/bluetooth/aioble/multitests/ble_write_order.py:48:5: F841 Local variable `task_first` is assigned to but never used

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

Check failure on line 52 in micropython/bluetooth/aioble/multitests/ble_write_order.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F841)

micropython/bluetooth/aioble/multitests/ble_write_order.py:52:5: F841 Local variable `task_dummy` is assigned to but never used

Check failure on line 52 in micropython/bluetooth/aioble/multitests/ble_write_order.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F823)

micropython/bluetooth/aioble/multitests/ble_write_order.py:52:38: F823 Local variable `task_dummy` referenced before assignment

multitest.globals(BDADDR=aioble.config("mac"))
multitest.next()
Expand Down

0 comments on commit 68ae281

Please sign in to comment.