summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_secrets.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-12-30 05:54:25 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-12-30 05:54:25 (GMT)
commite9ee207622f0f78e31b8277ccb9eaa895ea3472d (patch)
treeb1f0113b031a3dcc5343a68393337ecd94b58bd8 /Lib/test/test_secrets.py
parent9ea82ddad55d38ffad3cff5ce8afadaf0eaa59a3 (diff)
downloadcpython-e9ee207622f0f78e31b8277ccb9eaa895ea3472d.zip
cpython-e9ee207622f0f78e31b8277ccb9eaa895ea3472d.tar.gz
cpython-e9ee207622f0f78e31b8277ccb9eaa895ea3472d.tar.bz2
Issue #29061: secrets.randbelow() would hang with a negative input
Diffstat (limited to 'Lib/test/test_secrets.py')
-rw-r--r--Lib/test/test_secrets.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_secrets.py b/Lib/test/test_secrets.py
index 4c65cf0..d31d07e 100644
--- a/Lib/test/test_secrets.py
+++ b/Lib/test/test_secrets.py
@@ -70,6 +70,7 @@ class Random_Tests(unittest.TestCase):
for i in range(2, 10):
self.assertIn(secrets.randbelow(i), range(i))
self.assertRaises(ValueError, secrets.randbelow, 0)
+ self.assertRaises(ValueError, secrets.randbelow, -1)
class Token_Tests(unittest.TestCase):