summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-05-28 16:06:36 +1000
committerDamien George <damien@micropython.org>2025-06-12 21:45:40 +1000
commite4d556b14931d0c5245cda585341f377f9186298 (patch)
tree02a7a4b56d3b6fda70f352994625e1b833a80400
parent9bde12597a6980ff87ff0137a2616e6e430a1a0e (diff)
tests/extmod/random_extra_float.py: Skip when funcs not available.
This test was factored out from `random_extra.py` back in commit 6572029dc0665e58c2ea7355c9e541bdf83105a4, and the skip logic copied from that file. But the skip logic needs to test that the `random` and `uniform` functions exist, not `randint`. This commit fixes that skip logic. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tests/extmod/random_extra_float.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/extmod/random_extra_float.py b/tests/extmod/random_extra_float.py
index 3b37ed8dc..03973c583 100644
--- a/tests/extmod/random_extra_float.py
+++ b/tests/extmod/random_extra_float.py
@@ -1,12 +1,8 @@
try:
import random
-except ImportError:
- print("SKIP")
- raise SystemExit
-try:
- random.randint
-except AttributeError:
+ random.random
+except (ImportError, AttributeError):
print("SKIP")
raise SystemExit