summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_random.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index e648045..4b5232f 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -338,6 +338,11 @@ class MersenneTwister_TestBasicOps(TestBasicOps, unittest.TestCase):
self.assertRaises(TypeError, self.gen.setstate, (2, ('a',)*625, None))
# Last element s/b an int also
self.assertRaises(TypeError, self.gen.setstate, (2, (0,)*624+('a',), None))
+ # Last element s/b between 0 and 624
+ with self.assertRaises((ValueError, OverflowError)):
+ self.gen.setstate((2, (1,)*624+(625,), None))
+ with self.assertRaises((ValueError, OverflowError)):
+ self.gen.setstate((2, (1,)*624+(-1,), None))
# Little trick to make "tuple(x % (2**32) for x in internalstate)"
# raise ValueError. I cannot think of a simple way to achieve this, so