diff options
author | Raymond Hettinger <python@rcn.com> | 2016-10-12 05:42:10 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-10-12 05:42:10 (GMT) |
commit | 1c3a121bb04b716b9387f6eed7ee6120ed140f9d (patch) | |
tree | 6b3da8b84dd03b0fe173ad57b928c436a5d217e4 /Lib/test/test_random.py | |
parent | 95b826d05051b866fc4715ec2712adf1f134a7a5 (diff) | |
download | cpython-1c3a121bb04b716b9387f6eed7ee6120ed140f9d.zip cpython-1c3a121bb04b716b9387f6eed7ee6120ed140f9d.tar.gz cpython-1c3a121bb04b716b9387f6eed7ee6120ed140f9d.tar.bz2 |
Issue #18844: Fix-up examples for random.choices(). Remove over-specified test.
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r-- | Lib/test/test_random.py | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 0dfc290..840f3e7 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -178,8 +178,6 @@ class TestBasicOps: self.assertTrue(set(choices(data, weights=None, k=5)) <= set(data)) with self.assertRaises(ValueError): choices(data, [1,2], k=5) # len(weights) != len(population) - with self.assertRaises(IndexError): - choices(data, [0]*4, k=5) # weights sum to zero with self.assertRaises(TypeError): choices(data, 10, k=5) # non-iterable weights with self.assertRaises(TypeError): @@ -194,8 +192,6 @@ class TestBasicOps: with self.assertRaises(ValueError): choices(data, cum_weights=[1,2], k=5) # len(weights) != len(population) - with self.assertRaises(IndexError): - choices(data, cum_weights=[0]*4, k=5) # cum_weights sum to zero with self.assertRaises(TypeError): choices(data, cum_weights=10, k=5) # non-iterable cum_weights with self.assertRaises(TypeError): |