Make test_warnings re-entrant.
This commit is contained in:
parent
7f686fce40
commit
855da6cbbf
|
@ -1,5 +1,6 @@
|
||||||
import warnings
|
import warnings
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
from test import test_support
|
from test import test_support
|
||||||
|
|
||||||
|
@ -101,6 +102,10 @@ def test_main(verbose=None):
|
||||||
# to test_main (regrtest -R).
|
# to test_main (regrtest -R).
|
||||||
if '__warningregistry__' in globals():
|
if '__warningregistry__' in globals():
|
||||||
del globals()['__warningregistry__']
|
del globals()['__warningregistry__']
|
||||||
|
if hasattr(warning_tests, '__warningregistry__'):
|
||||||
|
del warning_tests.__warningregistry__
|
||||||
|
if hasattr(sys, '__warningregistry__'):
|
||||||
|
del sys.__warningregistry__
|
||||||
test_support.run_unittest(TestModule)
|
test_support.run_unittest(TestModule)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue