summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_random.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-11-26 20:49:42 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-11-26 20:49:42 (GMT)
commitc0aa2457d81ce65a80260472189812c7211f47fb (patch)
treed567bc835f96a59b60bd41328529b782af7fbdc0 /Lib/test/test_random.py
parentdafda9b042cb8a53e59a8d33a75692795097f154 (diff)
downloadcpython-c0aa2457d81ce65a80260472189812c7211f47fb.zip
cpython-c0aa2457d81ce65a80260472189812c7211f47fb.tar.gz
cpython-c0aa2457d81ce65a80260472189812c7211f47fb.tar.bz2
Issue #19588: Fixed tests in test_random that were silently skipped most
of the time. Patch by Julian Gindi.
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r--Lib/test/test_random.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index 3316415..911bdec 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -251,10 +251,10 @@ class SystemRandom_TestBasicOps(TestBasicOps):
def test_bigrand_ranges(self):
for i in [40,80, 160, 200, 211, 250, 375, 512, 550]:
- start = self.gen.randrange(2 ** i)
- stop = self.gen.randrange(2 ** (i-2))
+ start = self.gen.randrange(2 ** (i-2))
+ stop = self.gen.randrange(2 ** i)
if stop <= start:
- return
+ continue
self.assertTrue(start <= self.gen.randrange(start, stop) < stop)
def test_rangelimits(self):
@@ -403,10 +403,10 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
def test_bigrand_ranges(self):
for i in [40,80, 160, 200, 211, 250, 375, 512, 550]:
- start = self.gen.randrange(2 ** i)
- stop = self.gen.randrange(2 ** (i-2))
+ start = self.gen.randrange(2 ** (i-2))
+ stop = self.gen.randrange(2 ** i)
if stop <= start:
- return
+ continue
self.assertTrue(start <= self.gen.randrange(start, stop) < stop)
def test_rangelimits(self):