summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/urandom_basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod/urandom_basic.py')
-rw-r--r--tests/extmod/urandom_basic.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/extmod/urandom_basic.py b/tests/extmod/urandom_basic.py
index 7e4d8bf34c..bf00035bd5 100644
--- a/tests/extmod/urandom_basic.py
+++ b/tests/extmod/urandom_basic.py
@@ -17,3 +17,9 @@ random.seed(1)
r = random.getrandbits(16)
random.seed(1)
print(random.getrandbits(16) == r)
+
+# check that it throws an error for zero bits
+try:
+ random.getrandbits(0)
+except ValueError:
+ print('ValueError')