summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-11-26 20:50:10 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-11-26 20:50:10 (GMT)
commita6edea530bb9f3a9ff6234f443ea5d00428a7635 (patch)
treee122fd552a3506e894c4959a009552ef6c24bedc
parenta04f4e0374256adddbb84ece0b30c9bcaa66d144 (diff)
downloadcpython-a6edea530bb9f3a9ff6234f443ea5d00428a7635.zip
cpython-a6edea530bb9f3a9ff6234f443ea5d00428a7635.tar.gz
cpython-a6edea530bb9f3a9ff6234f443ea5d00428a7635.tar.bz2
Issue #19588: Fixed tests in test_random that were silently skipped most
of the time. Patch by Julian Gindi.
-rw-r--r--Lib/test/test_random.py12
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
3 files changed, 10 insertions, 6 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index facddb1..d363a6a 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -194,10 +194,10 @@ class SystemRandom_TestBasicOps(TestBasicOps, unittest.TestCase):
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):
@@ -357,10 +357,10 @@ class MersenneTwister_TestBasicOps(TestBasicOps, unittest.TestCase):
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):
diff --git a/Misc/ACKS b/Misc/ACKS
index 5b0f8b0..39b0f70 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -435,6 +435,7 @@ Dinu Gherman
Jonathan Giddy
Johannes Gijsbers
Michael Gilfix
+Julian Gindi
Yannick Gingras
Matt Giuca
Wim Glenn
diff --git a/Misc/NEWS b/Misc/NEWS
index 84217e7..f488230 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -65,6 +65,9 @@ Library
Tests
-----
+- Issue #19588: Fixed tests in test_random that were silently skipped most
+ of the time. Patch by Julian Gindi.
+
- Issue #19596: Set untestable tests in test_importlib to None to avoid
reporting success on empty tests.