summaryrefslogtreecommitdiff
path: root/tests/extmod/machine_soft_timer.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-09-14 11:50:29 +1000
committerDamien George <damien@micropython.org>2025-10-01 23:59:05 +1000
commita3a2b9e9738332eb9033bc1c227c9a69e9476e97 (patch)
treee8bcfdd91e53cd7a9afdff73c9505a4ee025c71b /tests/extmod/machine_soft_timer.py
parentc176fe8702cd806cbd0981234a4d7328e37b1673 (diff)
tests/extmod: Improve skip detection of extmod tests.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/machine_soft_timer.py')
-rw-r--r--tests/extmod/machine_soft_timer.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/extmod/machine_soft_timer.py b/tests/extmod/machine_soft_timer.py
index 1e9c66aa2..aa19becd8 100644
--- a/tests/extmod/machine_soft_timer.py
+++ b/tests/extmod/machine_soft_timer.py
@@ -1,20 +1,18 @@
# test "soft" machine.Timer (no hardware ID)
import sys
-
-if sys.platform in ("esp32", "esp8266"):
- print("SKIP") # TODO: Implement soft timers for esp32/esp8266 ports
- raise SystemExit
-
-
try:
- import time, machine as machine
+ import time, machine
machine.Timer
except:
print("SKIP")
raise SystemExit
+if sys.platform in ("esp32", "esp8266"):
+ print("SKIP") # TODO: Implement soft timers for esp32/esp8266 ports
+ raise SystemExit
+
# create and deinit
t = machine.Timer(freq=1)
t.deinit()