tests/ports/unix: Improve skip detection for os.getenv and time module.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2025-09-15 13:41:10 +10:00
parent 9b5e20dc20
commit 9a37e2feb9
2 changed files with 8 additions and 1 deletions

View File

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

View File

@@ -1,4 +1,8 @@
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]