summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-09-14 19:33:26 +1000
committerDamien George <damien@micropython.org>2025-10-02 00:04:04 +1000
commitcd6d9387105e5fca9764283e4b3b27b3b83d37ce (patch)
treef9c4e62962a3dc4d33b8b0801587a3366b3ac645
parent7373cbba6b6f32476fc68a40a11fcba1cf1c7d3c (diff)
tests/extmod/asyncio_heaplock.py: Improve skip detection of test.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/extmod/asyncio_heaplock.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/extmod/asyncio_heaplock.py b/tests/extmod/asyncio_heaplock.py
index 8326443f0..9e9908de1 100644
--- a/tests/extmod/asyncio_heaplock.py
+++ b/tests/extmod/asyncio_heaplock.py
@@ -4,7 +4,11 @@
# - StreamWriter.write, stream is blocked and data to write is a bytes object
# - StreamWriter.write, when stream is not blocked
-import micropython
+try:
+ import asyncio, micropython
+except ImportError:
+ print("SKIP")
+ raise SystemExit
# strict stackless builds can't call functions without allocating a frame on the heap
try:
@@ -24,12 +28,6 @@ except RuntimeError:
print("SKIP")
raise SystemExit
-try:
- import asyncio
-except ImportError:
- print("SKIP")
- raise SystemExit
-
class TestStream:
def __init__(self, blocked):