[Python-checkins] r83639 - python/branches/release26-maint/Lib/test/test_long_future.py

ezio.melotti python-checkins at python.org
Tue Aug 3 09:01:05 CEST 2010


Author: ezio.melotti
Date: Tue Aug  3 09:01:05 2010
New Revision: 83639

Log:
Fix deprecation warnings in test_long_future.py

Modified:
   python/branches/release26-maint/Lib/test/test_long_future.py

Modified: python/branches/release26-maint/Lib/test/test_long_future.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_long_future.py	(original)
+++ python/branches/release26-maint/Lib/test/test_long_future.py	Tue Aug  3 09:01:05 2010
@@ -4,7 +4,7 @@
 # trick just part of test_long into using future division.
 
 import unittest
-from test.test_support import run_unittest
+from test.test_support import run_unittest, _check_py3k_warnings
 
 class TrueDivisionTests(unittest.TestCase):
     def test(self):
@@ -44,8 +44,9 @@
             self.assertEqual(result, 0.0,
                              "expected underflow to 0 from %r" % underflow)
 
-        for zero in ["huge / 0", "huge / 0L", "mhuge / 0", "mhuge / 0L"]:
-            self.assertRaises(ZeroDivisionError, eval, zero, namespace)
+        with _check_py3k_warnings(('classic long division', DeprecationWarning)):
+            for zero in ["huge / 0", "huge / 0L", "mhuge / 0", "mhuge / 0L"]:
+                self.assertRaises(ZeroDivisionError, eval, zero, namespace)
 
 
 def test_main():


More information about the Python-checkins mailing list