Index: Lib/test/test_cgi.py =================================================================== --- Lib/test/test_cgi.py (revision 77822) +++ Lib/test/test_cgi.py (working copy) @@ -1,4 +1,4 @@ -from test.test_support import run_unittest +from test.test_support import run_unittest, check_warnings import cgi import os import sys @@ -104,7 +104,7 @@ def norm(list): if type(list) == type([]): - list.sort() + list.sort(key=str) return list def first_elts(list): @@ -345,14 +345,16 @@ self.assertEqual(result, v) def test_deprecated_parse_qs(self): - # this func is moved to urlparse, this is just a sanity check - self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']}, - cgi.parse_qs('a=A1&b=B2&B=B3')) + with check_warnings(): + # this func is moved to urlparse, this is just a sanity check + self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']}, + cgi.parse_qs('a=A1&b=B2&B=B3')) def test_deprecated_parse_qsl(self): - # this func is moved to urlparse, this is just a sanity check - self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], - cgi.parse_qsl('a=A1&b=B2&B=B3')) + with check_warnings(): + # this func is moved to urlparse, this is just a sanity check + self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')], + cgi.parse_qsl('a=A1&b=B2&B=B3')) def test_parse_header(self): self.assertEqual( Index: Lib/test/test_coercion.py =================================================================== --- Lib/test/test_coercion.py (revision 77822) +++ Lib/test/test_coercion.py (working copy) @@ -223,8 +223,10 @@ infix_results[key] = res - -process_infix_results() +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "classic int division", + DeprecationWarning) + process_infix_results() # now infix_results has two lists of results for every pairing. prefix_binops = [ 'divmod' ] @@ -337,11 +339,12 @@ raise exc def test_main(): - warnings.filterwarnings("ignore", - r'complex divmod\(\), // and % are deprecated', - DeprecationWarning, - r'test.test_coercion$') - run_unittest(CoercionTest) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "complex divmod.., // and % " + "are deprecated", DeprecationWarning) + warnings.filterwarnings("ignore", "classic .+ division", + DeprecationWarning) + run_unittest(CoercionTest) if __name__ == "__main__": test_main() Index: Lib/test/test_distutils.py =================================================================== --- Lib/test/test_distutils.py (revision 77822) +++ Lib/test/test_distutils.py (working copy) @@ -7,10 +7,14 @@ import distutils.tests import test.test_support +import warnings def test_main(): - test.test_support.run_unittest(distutils.tests.test_suite()) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "distutils.sysconfig.+ " + "is deprecated.", DeprecationWarning) + test.test_support.run_unittest(distutils.tests.test_suite()) test.test_support.reap_children() Index: Lib/test/test_userstring.py =================================================================== --- Lib/test/test_userstring.py (revision 77822) +++ Lib/test/test_userstring.py (working copy) @@ -138,6 +138,8 @@ with warnings.catch_warnings(): warnings.filterwarnings("ignore", ".*MutableString", DeprecationWarning) + warnings.filterwarnings("ignore", ".+slice__ has been removed", + DeprecationWarning) test_support.run_unittest(UserStringTest, MutableStringTest) if __name__ == "__main__":