Skip these tests when using --emit native

.. in which case the __await__ attribute is not available due to
"CIRCUITPY: no support for mp_type_native_coro_wrap" (emitglue.c)
This commit is contained in:
Jeff Epler 2023-08-20 08:02:31 -05:00
parent b0bf36ef3b
commit 562520e158
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
7 changed files with 72 additions and 0 deletions

View File

@ -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())

View File

@ -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

View File

@ -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)

View File

@ -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):

View File

@ -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"]))

View File

@ -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:

View File

@ -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")