summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-09-15 13:41:10 +1000
committerDamien George <damien@micropython.org>2025-10-02 00:37:29 +1000
commit9a37e2feb93079dc3154db3f891d21e4fd80b0fa (patch)
treeea244725116b3e9e4550b059355fbcf25ea5c907
parent9b5e20dc20b54df432460d81a3a6189f6d601226 (diff)
tests/ports/unix: Improve skip detection for os.getenv and time module.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/ports/unix/mod_os.py3
-rw-r--r--tests/ports/unix/time_mktime_localtime.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/ports/unix/mod_os.py b/tests/ports/unix/mod_os.py
index f69fa45b2..468f6badd 100644
--- a/tests/ports/unix/mod_os.py
+++ b/tests/ports/unix/mod_os.py
@@ -1,6 +1,9 @@
# This module is not entirely compatible with CPython
import os
+if not hasattr(os, "getenv"):
+ print("SKIP")
+ raise SystemExit
os.putenv("TEST_VARIABLE", "TEST_VALUE")
diff --git a/tests/ports/unix/time_mktime_localtime.py b/tests/ports/unix/time_mktime_localtime.py
index d1c03c103..df5d6cda6 100644
--- a/tests/ports/unix/time_mktime_localtime.py
+++ b/tests/ports/unix/time_mktime_localtime.py
@@ -1,4 +1,8 @@
-import time
+try:
+ import time
+except ImportError:
+ print("SKIP")
+ raise SystemExit
DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]