diff --git a/tests/extmod/uasyncio_await_return.py b/tests/extmod/uasyncio_await_return.py index d375c9ea97..4a45d9b9c0 100644 --- a/tests/extmod/uasyncio_await_return.py +++ b/tests/extmod/uasyncio_await_return.py @@ -14,6 +14,13 @@ async def foo(): return 42 +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + + async def main(): # Call function directly via an await print(await foo()) diff --git a/tests/extmod/uasyncio_basic.py b/tests/extmod/uasyncio_basic.py index 20c0a82e47..baf9d193fe 100644 --- a/tests/extmod/uasyncio_basic.py +++ b/tests/extmod/uasyncio_basic.py @@ -8,6 +8,16 @@ except ImportError: raise SystemExit +async def foo(): + return 42 + + +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + try: import utime diff --git a/tests/extmod/uasyncio_event_fair.py b/tests/extmod/uasyncio_event_fair.py index 37eca5faef..1eee0bd7e8 100644 --- a/tests/extmod/uasyncio_event_fair.py +++ b/tests/extmod/uasyncio_event_fair.py @@ -11,6 +11,17 @@ except ImportError: raise SystemExit +async def foo(): + return 42 + + +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + + async def task1(id): for i in range(4): print("sleep", id) diff --git a/tests/extmod/uasyncio_gather.py b/tests/extmod/uasyncio_gather.py index c081221c9f..e34176a31d 100644 --- a/tests/extmod/uasyncio_gather.py +++ b/tests/extmod/uasyncio_gather.py @@ -10,6 +10,17 @@ except ImportError: raise SystemExit +async def foo(): + return 42 + + +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + + async def factorial(name, number): f = 1 for i in range(2, number + 1): diff --git a/tests/extmod/uasyncio_gather_notimpl.py b/tests/extmod/uasyncio_gather_notimpl.py index 3ebab9bad6..63ba645d24 100644 --- a/tests/extmod/uasyncio_gather_notimpl.py +++ b/tests/extmod/uasyncio_gather_notimpl.py @@ -10,6 +10,17 @@ except ImportError: raise SystemExit +async def foo(): + return 42 + + +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + + def custom_handler(loop, context): print(repr(context["exception"])) diff --git a/tests/extmod/uasyncio_lock_cancel.py b/tests/extmod/uasyncio_lock_cancel.py index 85b8df8483..27428da80b 100644 --- a/tests/extmod/uasyncio_lock_cancel.py +++ b/tests/extmod/uasyncio_lock_cancel.py @@ -10,6 +10,17 @@ except ImportError: raise SystemExit +async def foo(): + return 42 + + +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + + async def task(i, lock, lock_flag): print("task", i, "start") try: diff --git a/tests/extmod/uasyncio_wait_for_fwd.py b/tests/extmod/uasyncio_wait_for_fwd.py index 33738085ce..e608f63f6b 100644 --- a/tests/extmod/uasyncio_wait_for_fwd.py +++ b/tests/extmod/uasyncio_wait_for_fwd.py @@ -10,6 +10,17 @@ except ImportError: raise SystemExit +async def foo(): + return 42 + + +try: + foo().__await__ +except AttributeError: + print("SKIP") + raise SystemExit + + async def awaiting(t, return_if_fail): try: print("awaiting started")