summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_random.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-08-02 18:10:09 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-08-02 18:10:09 (GMT)
commitf613f352d05cafbec6c4524c67f3eed00a0c4857 (patch)
treefe0e22ba0c4a6de17a04580c26cf19c8cc136528 /Lib/test/test_random.py
parent800a354fa946d777b8df92e5b0bd07e92f6f9a3b (diff)
downloadcpython-f613f352d05cafbec6c4524c67f3eed00a0c4857.zip
cpython-f613f352d05cafbec6c4524c67f3eed00a0c4857.tar.gz
cpython-f613f352d05cafbec6c4524c67f3eed00a0c4857.tar.bz2
Merged revisions 78758 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78758 | florent.xicluna | 2010-03-07 14:18:33 +0200 (Sun, 07 Mar 2010) | 4 lines Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are effectively raised. A new utility ``check_py3k_warnings`` deals with py3k warnings. ........
Diffstat (limited to 'Lib/test/test_random.py')
-rw-r--r--Lib/test/test_random.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index d82d391..937bb4c 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -52,10 +52,11 @@ 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
+ with test_support._check_py3k_warnings(quiet=True):
+ 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