From: Antoine Pitrou Date: Wed, 14 Oct 2009 18:56:11 +0000 (+0000) Subject: Silence py3k warning claiming to affect the random module X-Git-Tag: v2.7a1~350 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b844ef795059b1be5d7171d4268735a3de7edeae;p=python Silence py3k warning claiming to affect the random module --- diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 30bd330734..14d0383b03 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -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