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.
........
diff --git a/Lib/test/test_commands.py b/Lib/test/test_commands.py
index dc1a598..5cb6e86 100644
--- a/Lib/test/test_commands.py
+++ b/Lib/test/test_commands.py
@@ -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 @@
                   /\.          # 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():