From: Benjamin Peterson Date: Mon, 19 Jan 2009 21:08:37 +0000 (+0000) Subject: I'm sick of these deprecations warnings in test_os X-Git-Tag: v2.7a1~2245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f01cd013ff153b92dc7fed13ace419a5d024da7;p=thirdparty%2FPython%2Fcpython.git I'm sick of these deprecations warnings in test_os --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index cd310ea9775d..81d1671b4bf2 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -505,9 +505,11 @@ class URandomTests (unittest.TestCase): self.assertEqual(len(os.urandom(100)), 100) self.assertEqual(len(os.urandom(1000)), 1000) # see http://bugs.python.org/issue3708 - self.assertEqual(len(os.urandom(0.9)), 0) - self.assertEqual(len(os.urandom(1.1)), 1) - self.assertEqual(len(os.urandom(2.0)), 2) + with test_support.check_warnings(): + # silence deprecation warnings about float arguments + self.assertEqual(len(os.urandom(0.9)), 0) + self.assertEqual(len(os.urandom(1.1)), 1) + self.assertEqual(len(os.urandom(2.0)), 2) except NotImplementedError: pass