diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-04-16 00:01:09 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-04-16 00:01:09 (GMT) |
commit | 7d79948103ebe6922144ef81919c8b12c434cbb8 (patch) | |
tree | 916e43df4a0e702d2dd14f9e81932b6e6df43a9f /Lib/test | |
parent | a91a02a76d35bedb5eb9ed2b06c43c0250a872c8 (diff) | |
download | cpython-7d79948103ebe6922144ef81919c8b12c434cbb8.zip cpython-7d79948103ebe6922144ef81919c8b12c434cbb8.tar.gz cpython-7d79948103ebe6922144ef81919c8b12c434cbb8.tar.bz2 |
It makes more sense to call resetwarnings() after every test runs than
to keep doing that in every test that wants to filter a warning.
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/regrtest.py | 2 | ||||
-rw-r--r-- | Lib/test/test___all__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_coercion.py | 7 | ||||
-rw-r--r-- | Lib/test/test_xmllib.py | 2 |
4 files changed, 4 insertions, 9 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 18decfe..8e8deae 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -55,6 +55,7 @@ import getopt import traceback import random import StringIO +import warnings import test_support @@ -322,6 +323,7 @@ def runtest(test, generate, verbose, quiet, testdir = None): indirect_test() finally: sys.stdout = save_stdout + warnings.resetwarnings() except (ImportError, test_support.TestSkipped), msg: if not quiet: print "test", test, "skipped --", msg diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 2890066..299054f 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -158,5 +158,3 @@ check_all("weakref") check_all("webbrowser") check_all("xdrlib") check_all("zipfile") - -warnings.resetwarnings() diff --git a/Lib/test/test_coercion.py b/Lib/test/test_coercion.py index 6c0ee7b..4be762e 100644 --- a/Lib/test/test_coercion.py +++ b/Lib/test/test_coercion.py @@ -113,8 +113,5 @@ def do_prefix_binops(): warnings.filterwarnings("ignore", r'complex divmod\(\), // and % are deprecated', DeprecationWarning) -try: - do_infix_binops() - do_prefix_binops() -finally: - warnings.resetwarnings() +do_infix_binops() +do_prefix_binops() diff --git a/Lib/test/test_xmllib.py b/Lib/test/test_xmllib.py index 6756b64..1284a2c 100644 --- a/Lib/test/test_xmllib.py +++ b/Lib/test/test_xmllib.py @@ -32,8 +32,6 @@ class XMLParserTestCase(unittest.TestCase): def test_main(): test_support.run_unittest(XMLParserTestCase) - warnings.resetwarnings() - if __name__ == "__main__": test_main() |