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.
........
This commit is contained in:
Ezio Melotti 2010-08-02 23:34:49 +00:00
parent cc436eb6e8
commit 1d55ec329a
20 changed files with 98 additions and 149 deletions

View file

@ -4,13 +4,11 @@
'''
import unittest
import os, tempfile, re
import warnings
warnings.filterwarnings('ignore', r".*commands.getstatus.. is deprecated",
DeprecationWarning)
from test.test_support import run_unittest, reap_children, import_module, \
check_warnings
from test.test_support import TestSkipped, run_unittest, reap_children, import_module
# Silence Py3k warning
import_module('commands', deprecated=True)
from commands import *
@ -60,7 +58,11 @@ class CommandTests(unittest.TestCase):
/\. # and end with the name of the file.
'''
self.assert_(re.match(pat, getstatus("/."), re.VERBOSE))
with check_warnings((".*commands.getstatus.. is deprecated",
DeprecationWarning),
("in 3.x, mkarg has been removed",
DeprecationWarning),):
self.assertTrue(re.match(pat, getstatus("/."), re.VERBOSE))
def test_main():