Silence py3k warning claiming to affect the random module

This commit is contained in:
Antoine Pitrou 2009-10-14 18:56:11 +00:00
parent 9b4e5820cb
commit b844ef7950
1 changed files with 6 additions and 4 deletions

View File

@ -52,10 +52,12 @@ class TestBasicOps(unittest.TestCase):
state3 = self.gen.getstate() # s/b distinct from state2
self.assertNotEqual(state2, state3)
self.assertRaises(TypeError, self.gen.jumpahead) # needs an arg
self.assertRaises(TypeError, self.gen.jumpahead, "ick") # wrong type
self.assertRaises(TypeError, self.gen.jumpahead, 2.3) # wrong type
self.assertRaises(TypeError, self.gen.jumpahead, 2, 3) # too many
# Silence py3k warnings
with test_support.check_warnings():
self.assertRaises(TypeError, self.gen.jumpahead) # needs an arg
self.assertRaises(TypeError, self.gen.jumpahead, "ick") # wrong type
self.assertRaises(TypeError, self.gen.jumpahead, 2.3) # wrong type
self.assertRaises(TypeError, self.gen.jumpahead, 2, 3) # too many
def test_sample(self):
# For the entire allowable range of 0 <= k <= N, validate that