mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Fix deprecation warnings in test_long_future.py
This commit is contained in:
parent
aad1541484
commit
670048de80
1 changed files with 4 additions and 3 deletions
|
@ -4,7 +4,7 @@ from __future__ import division
|
|||
# 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 @@ class TrueDivisionTests(unittest.TestCase):
|
|||
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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue