summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_complex.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-08-02 23:34:49 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-08-02 23:34:49 (GMT)
commit1d55ec329a08c2d022d4d83887bd71755bc52026 (patch)
tree01731ecfcdb5a5be08ff566febb4de0cc047636a /Lib/test/test_complex.py
parentcc436eb6e83f231c4d5c1bfdd8565b6b4b45effa (diff)
downloadcpython-1d55ec329a08c2d022d4d83887bd71755bc52026.zip
cpython-1d55ec329a08c2d022d4d83887bd71755bc52026.tar.gz
cpython-1d55ec329a08c2d022d4d83887bd71755bc52026.tar.bz2
Merged revisions 79539 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79539 | florent.xicluna | 2010-04-01 01:01:03 +0300 (Thu, 01 Apr 2010) | 2 lines Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests. ........
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r--Lib/test/test_complex.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index 000dd9d..6342501 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -1,13 +1,6 @@
-import unittest, os
+import unittest
from test import test_support
-import warnings
-warnings.filterwarnings(
- "ignore",
- category=DeprecationWarning,
- message=".*complex divmod.*are deprecated"
-)
-
from random import random
from math import atan2
@@ -371,10 +364,7 @@ class ComplexTest(unittest.TestCase):
finally:
if (fo is not None) and (not fo.closed):
fo.close()
- try:
- os.remove(test_support.TESTFN)
- except (OSError, IOError):
- pass
+ test_support.unlink(test_support.TESTFN)
def test_getnewargs(self):
self.assertEqual((1+2j).__getnewargs__(), (1.0, 2.0))
@@ -392,7 +382,9 @@ class ComplexTest(unittest.TestCase):
self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.))
def test_main():
- test_support.run_unittest(ComplexTest)
+ with test_support.check_warnings(("complex divmod.., // and % are "
+ "deprecated", DeprecationWarning)):
+ test_support.run_unittest(ComplexTest)
if __name__ == "__main__":
test_main()