Skip to content

Commit c8b0229

Browse files
committed
tests: sha256: skip test if uhashlib module is not available.
1 parent 5cf7ac7 commit c8b0229

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/extmod/sha256.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
import sys
12
try:
23
import uhashlib as hashlib
34
except ImportError:
4-
import hashlib
5+
try:
6+
import hashlib
7+
except ImportError:
8+
# This is neither uPy, nor cPy, so must be uPy with
9+
# uhashlib module disabled.
10+
print("SKIP")
11+
sys.exit()
512

613

714
h = hashlib.sha256()

0 commit comments

Comments
 (0)