diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-06-24 11:24:05 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-06-24 11:24:05 +0100 |
commit | dd7987382d538ef7d9e90dacaee422f1a414060e (patch) | |
tree | e54ab60ecf30259bdcb3ff8147901287068856f7 /Lib/test/test_random.py | |
parent | d89dae18e85148449f23f05df953bb9a9fcd8af9 (diff) | |
parent | 78f075636cb222c9760a2e3a1235f976714d4c38 (diff) | |
download | cpython-git-dd7987382d538ef7d9e90dacaee422f1a414060e.tar.gz |
Merged upstream changes.
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r-- | Lib/test/test_random.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 776d0c4163..b5931baf4e 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -34,8 +34,12 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(randseq, self.randomlist(N)) def test_seedargs(self): + # Seed value with a negative hash. + class MySeed(object): + def __hash__(self): + return -1729 for arg in [None, 0, 0, 1, 1, -1, -1, 10**20, -(10**20), - 3.14, 1+2j, 'a', tuple('abc')]: + 3.14, 1+2j, 'a', tuple('abc'), MySeed()]: self.gen.seed(arg) for arg in [list(range(3)), dict(one=1)]: self.assertRaises(TypeError, self.gen.seed, arg) |