diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-01-08 19:04:16 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-01-08 19:04:16 (GMT) |
commit | ce8e33a095030e7af94f58f9da196b240bdf0476 (patch) | |
tree | b0ba50cbb6e85c6be6f6e6a870e4232be50a0f9c /Lib/test/test_builtin.py | |
parent | 3ddc435af6873c6304058d7bcbcb19ee4fba7781 (diff) | |
download | cpython-ce8e33a095030e7af94f58f9da196b240bdf0476.zip cpython-ce8e33a095030e7af94f58f9da196b240bdf0476.tar.gz cpython-ce8e33a095030e7af94f58f9da196b240bdf0476.tar.bz2 |
Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r-- | Lib/test/test_builtin.py | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index ac5b754..f20d543 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -7,6 +7,10 @@ from test.test_support import fcmp, have_unicode, TESTFN, unlink, \ from operator import neg import sys, warnings, cStringIO, random, fractions, UserDict +warnings.filterwarnings("ignore", "hex../oct.. of negative int", + FutureWarning, __name__) +warnings.filterwarnings("ignore", "integer argument expected", + DeprecationWarning, "unittest") # count the number of test runs. # used to skip running test_execfile() multiple times @@ -415,11 +419,7 @@ class BuiltinTest(unittest.TestCase): f.write('z = z+1\n') f.write('z = z*2\n') f.close() - with warnings.catch_warnings(): - # Silence Py3k warning - warnings.filterwarnings("ignore", ".+ not supported in 3.x", - DeprecationWarning) - execfile(TESTFN) + execfile(TESTFN) def test_execfile(self): global numruns @@ -1542,30 +1542,17 @@ class TestSorted(unittest.TestCase): data = 'The quick Brown fox Jumped over The lazy Dog'.split() self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0) -def _run_unittest(*args): - with warnings.catch_warnings(): - # Silence Py3k warnings - warnings.filterwarnings("ignore", ".+ not supported in 3.x", - DeprecationWarning) - warnings.filterwarnings("ignore", ".+ is renamed to imp.reload", - DeprecationWarning) - warnings.filterwarnings("ignore", "integer argument expected, got float", - DeprecationWarning) - warnings.filterwarnings("ignore", "classic int division", - DeprecationWarning) - run_unittest(*args) - def test_main(verbose=None): test_classes = (BuiltinTest, TestSorted) - _run_unittest(*test_classes) + run_unittest(*test_classes) # verify reference counting if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): - _run_unittest(*test_classes) + run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print counts |