diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-08-03 05:17:27 +0000 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-08-03 05:17:27 +0000 |
commit | c00b88cedb996008ae53ef9e6e36f7dac82eb693 (patch) | |
tree | d809488fbd5f2eda0e81eb7f96c0053842060656 /Lib/test/test_builtin.py | |
parent | 35099daee0dfb1a6973fbaf76c51662ce341a3ba (diff) | |
download | cpython-git-c00b88cedb996008ae53ef9e6e36f7dac82eb693.tar.gz |
Fix more warnings in test_builtin.
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r-- | Lib/test/test_builtin.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 1688f50c34..9401f6501f 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1577,17 +1577,25 @@ 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 _check_py3k_warnings( + (".+ not supported in 3.x", DeprecationWarning), + (".+ is renamed to imp.reload", DeprecationWarning), + ("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 |