From: Brett Cannon Date: Fri, 17 Aug 2007 20:16:15 +0000 (+0000) Subject: Make test_warnings re-entrant. X-Git-Tag: v2.6a1~1480 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=855da6cbbfe86d180abf0d2e03ccf1690cfbcaf4;p=python Make test_warnings re-entrant. --- diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py index cca632997b..66246cfd2e 100644 --- a/Lib/test/test_warnings.py +++ b/Lib/test/test_warnings.py @@ -1,5 +1,6 @@ import warnings import os +import sys import unittest from test import test_support @@ -101,6 +102,10 @@ def test_main(verbose=None): # to test_main (regrtest -R). if '__warningregistry__' in globals(): del globals()['__warningregistry__'] + if hasattr(warning_tests, '__warningregistry__'): + del warning_tests.__warningregistry__ + if hasattr(sys, '__warningregistry__'): + del sys.__warningregistry__ test_support.run_unittest(TestModule) if __name__ == "__main__":