summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-07-21 09:54:02 +1000
committerDamien George <damien@micropython.org>2022-07-26 18:16:19 +1000
commitb22abcdbbedb0f7583b19031fd65e19b3883671d (patch)
treecfafe633bf01c8e724363503b812b1317a828cee /tests
parent092784da1948c6bfb224f8f6c593aff255ab2db0 (diff)
downloadmicropython-b22abcdbbedb0f7583b19031fd65e19b3883671d.tar.gz
micropython-b22abcdbbedb0f7583b19031fd65e19b3883671d.zip
extmod/uasyncio: Handle gather with no awaitables.
This previously resulted in gather() yielding but with no way to be resumed. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/uasyncio_gather.py5
-rw-r--r--tests/extmod/uasyncio_gather.py.exp2
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/extmod/uasyncio_gather.py b/tests/extmod/uasyncio_gather.py
index c081221c9f..af6ea555ab 100644
--- a/tests/extmod/uasyncio_gather.py
+++ b/tests/extmod/uasyncio_gather.py
@@ -53,6 +53,11 @@ async def main():
print("====")
+ # Gather with no awaitables
+ print(await asyncio.gather())
+
+ print("====")
+
# Test return_exceptions, where one task is cancelled and the other finishes normally
tasks = [asyncio.create_task(task(1)), asyncio.create_task(task(2))]
tasks[0].cancel()
diff --git a/tests/extmod/uasyncio_gather.py.exp b/tests/extmod/uasyncio_gather.py.exp
index a5ea47ab50..371d1ae60d 100644
--- a/tests/extmod/uasyncio_gather.py.exp
+++ b/tests/extmod/uasyncio_gather.py.exp
@@ -9,6 +9,8 @@ Task C: Compute factorial(4)...
Task C: factorial(4) = 24
[2, 6, 24]
====
+[]
+====
start 2
end 2
[CancelledError(), 2]