[Python-checkins] r68785 - python/trunk/Lib/test/test_os.py
Nick Coghlan
ncoghlan at gmail.com
Tue Jan 20 11:00:35 CET 2009
benjamin.peterson wrote:
> + 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
If you're going to add the check_warnings call, you might as well add
the corresponding asserts to check that the DeprecationWarnings are
actually being emitted...
Cheers,
Nick.
P.S. I found those DeprecationWarnings annoying as well, I just never
thought to do anything about it
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
More information about the Python-checkins
mailing list