Index: Lib/test/regrtest.py =================================================================== --- Lib/test/regrtest.py (revision 77361) +++ Lib/test/regrtest.py (working copy) @@ -150,7 +150,6 @@ import cStringIO import getopt import itertools -import json import os import random import re @@ -160,15 +159,13 @@ import warnings import unittest -# I see no other way to suppress these warnings; -# putting them in test_grammar.py has no effect: -warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning, - ".*test.test_grammar$") -if sys.maxint > 0x7fffffff: - # Also suppress them in , because for 64-bit platforms, - # that's where test_grammar.py hides them. - warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning, - "") +with warnings.catch_warnings(): + # Silence Py3k warnings + warnings.filterwarnings("ignore", "tuple parameter unpacking " + "has been removed", SyntaxWarning) + warnings.filterwarnings("ignore", "assignment to True or False " + "is forbidden", SyntaxWarning) + import json # Ignore ImportWarnings that only occur in the source tree, # (because of modules with the same name as source-directories in Modules/) Index: Lib/test/test_json.py =================================================================== --- Lib/test/test_json.py (revision 77361) +++ Lib/test/test_json.py (working copy) @@ -7,10 +7,15 @@ import json.tests import test.test_support +import warnings def test_main(): - test.test_support.run_unittest(json.tests.test_suite()) + with warnings.catch_warnings(): + # Silence Py3k warning + warnings.filterwarnings("ignore", "comparing unequal types " + "not supported", DeprecationWarning) + test.test_support.run_unittest(json.tests.test_suite()) if __name__ == "__main__": Index: Lib/test/test_sqlite.py =================================================================== --- Lib/test/test_sqlite.py (revision 77361) +++ Lib/test/test_sqlite.py (working copy) @@ -4,14 +4,21 @@ # Skip test if _sqlite3 module was not built. import_module('_sqlite3') +import warnings from sqlite3.test import (dbapi, types, userfunctions, py25tests, factory, transactions, hooks, regression, dump) def test_main(): - run_unittest(dbapi.suite(), types.suite(), userfunctions.suite(), - py25tests.suite(), factory.suite(), transactions.suite(), - hooks.suite(), regression.suite(), dump.suite()) + with warnings.catch_warnings(): + # Silence Py3k warnings + warnings.filterwarnings("ignore", "buffer.. not supported", + DeprecationWarning) + warnings.filterwarnings("ignore", "classic int division", + DeprecationWarning) + run_unittest(dbapi.suite(), types.suite(), userfunctions.suite(), + py25tests.suite(), factory.suite(), transactions.suite(), + hooks.suite(), regression.suite(), dump.suite()) if __name__ == "__main__": test_main()