From c0aa2457d81ce65a80260472189812c7211f47fb Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Tue, 26 Nov 2013 14:49:42 -0600 Subject: [PATCH] Issue #19588: Fixed tests in test_random that were silently skipped most of the time. Patch by Julian Gindi. --- Lib/test/test_random.py | 12 ++++++------ Misc/ACKS | 1 + Misc/NEWS | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 33164150c3..911bdec552 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): diff --git a/Misc/ACKS b/Misc/ACKS index e276960db7..5e0342a64a 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -362,6 +362,7 @@ Dinu Gherman Jonathan Giddy Johannes Gijsbers Michael Gilfix +Julian Gindi Wim Glenn Christoph Gohlke Tim Golden diff --git a/Misc/NEWS b/Misc/NEWS index 6815aa22e8..3d054c00f4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -50,6 +50,9 @@ Library Tests ----- +- Issue #19588: Fixed tests in test_random that were silently skipped most + of the time. Patch by Julian Gindi. + - Issue #17883: Tweak test_tcl testLoadWithUNC to skip the test in the event of a permission error on Windows and to properly report other skip conditions. -- 2.50.1