]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
I'm sick of these deprecations warnings in test_os
authorBenjamin Peterson <benjamin@python.org>
Mon, 19 Jan 2009 21:08:37 +0000 (21:08 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 19 Jan 2009 21:08:37 +0000 (21:08 +0000)
Lib/test/test_os.py

index cd310ea9775d99473c9bc4571504763095b8df4f..81d1671b4bf232ba00bf14b6e2decaf4b7d1a6d1 100644 (file)
@@ -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