summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-01-01 17:27:30 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-01-01 17:27:30 (GMT)
commit1b34d2552c2cb2369130291a8a9ae973753b4072 (patch)
tree5bfcf8b49745280e0a92a49ef2102d81c3674b68 /Lib/test/test_os.py
parentedfe72f66fd789d65b0c7125540c08d3e98a901e (diff)
downloadcpython-1b34d2552c2cb2369130291a8a9ae973753b4072.zip
cpython-1b34d2552c2cb2369130291a8a9ae973753b4072.tar.gz
cpython-1b34d2552c2cb2369130291a8a9ae973753b4072.tar.bz2
Issue #5080: turn the DeprecationWarning from float arguments passed
to integer PyArg_Parse* format codes into a TypeError. Add a DeprecationWarning for floats passed with the 'L' format code, which didn't previously have a warning.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 207963e..ec9b970 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -502,11 +502,9 @@ class URandomTests (unittest.TestCase):
self.assertEqual(len(os.urandom(100)), 100)
self.assertEqual(len(os.urandom(1000)), 1000)
# see http://bugs.python.org/issue3708
- 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)
+ self.assertRaises(TypeError, os.urandom, 0.9)
+ self.assertRaises(TypeError, os.urandom, 1.1)
+ self.assertRaises(TypeError, os.urandom, 2.0)
except NotImplementedError:
pass