summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_random.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r--Lib/test/test_random.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index 9c2e0d0..c9431b3 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -96,6 +96,9 @@ class TestBasicOps(unittest.TestCase):
self.gen.sample(dict.fromkeys('abcdefghijklmnopqrst'), 2)
self.gen.sample(str('abcdefghijklmnopqrst'), 2)
self.gen.sample(tuple('abcdefghijklmnopqrst'), 2)
+ # SF bug #1460340 -- random.sample can raise KeyError
+ a = dict.fromkeys(range(10)+range(10,100,2)+range(100,110))
+ self.gen.sample(a,3)
def test_gauss(self):
# Ensure that the seed() method initializes all the hidden state. In