summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_random.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2013-04-13 15:00:04 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2013-04-13 15:00:04 (GMT)
commitb4fd468f125955b14f53e77e1f29b216ca888c88 (patch)
tree7c640692ea514f6c5c067a3eadc5fdcf05dc5bf4 /Lib/test/test_random.py
parent64aafeb4de3b5e85007f2107250e6f1da4df2516 (diff)
downloadcpython-b4fd468f125955b14f53e77e1f29b216ca888c88.zip
cpython-b4fd468f125955b14f53e77e1f29b216ca888c88.tar.gz
cpython-b4fd468f125955b14f53e77e1f29b216ca888c88.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.py32
1 files changed, 1 insertions, 31 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index 34e144c..c3ab7d2 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -46,36 +46,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)
-
def test_choice(self):
choice = self.gen.choice
with self.assertRaises(IndexError):
@@ -519,7 +489,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),