diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2013-04-13 15:04:19 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2013-04-13 15:04:19 (GMT) |
commit | 44e33f39bf6268e8cf6dc807ea6c0f50d30919f9 (patch) | |
tree | 3fa1b3855d2269e98d437dcc0ba4844cbfebb727 /Lib/test/test_random.py | |
parent | 556e94b8fe068d1d58064fe84467e0620b87f9ed (diff) | |
parent | b4fd468f125955b14f53e77e1f29b216ca888c88 (diff) | |
download | cpython-44e33f39bf6268e8cf6dc807ea6c0f50d30919f9.zip cpython-44e33f39bf6268e8cf6dc807ea6c0f50d30919f9.tar.gz cpython-44e33f39bf6268e8cf6dc807ea6c0f50d30919f9.tar.bz2 |
Revert changes for #13355 by request from Raymond Hettinger
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r-- | Lib/test/test_random.py | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index fa03073..437a20f 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -48,33 +48,6 @@ class TestBasicOps(unittest.TestCase): self.assertRaises(TypeError, self.gen.seed, 1, 2, 3, 4) self.assertRaises(TypeError, type(self.gen), []) - def test_triangular(self): - # Check that triangular() correctly handles bad input. See issue 13355. - # mode > high. - with self.assertRaises(ValueError): - random.triangular(mode=2) - with self.assertRaises(ValueError): - random.triangular(low=1, high=10, mode=11) - with self.assertRaises(ValueError): - random.triangular(low=1, high=1, mode=11) - # mode < low. - with self.assertRaises(ValueError): - random.triangular(mode=-1) - with self.assertRaises(ValueError): - random.triangular(low=1, high=10, mode=0) - with self.assertRaises(ValueError): - random.triangular(low=1, high=1, mode=0) - # low > high - with self.assertRaises(ValueError): - random.triangular(low=5, high=2) - with self.assertRaises(ValueError): - random.triangular(low=5, high=2, mode=1) - with self.assertRaises(ValueError): - random.triangular(low=-2, high=-5) - - self.assertEqual(random.triangular(low=10, high=10), 10) - self.assertEqual(random.triangular(low=10, high=10, mode=10), 10) - @unittest.mock.patch('random._urandom') # os.urandom def test_seed_when_randomness_source_not_found(self, urandom_mock): # Random.seed() uses time.time() when an operating system specific @@ -623,7 +596,7 @@ class TestDistributions(unittest.TestCase): for variate, args, expected in [ (g.uniform, (10.0, 10.0), 10.0), (g.triangular, (10.0, 10.0), 10.0), - (g.triangular, (10.0, 10.0, 10.0), 10.0), + #(g.triangular, (10.0, 10.0, 10.0), 10.0), (g.expovariate, (float('inf'),), 0.0), (g.vonmisesvariate, (3.0, float('inf')), 3.0), (g.gauss, (10.0, 0.0), 10.0), |