mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Make test_warnings play nice with regrtest -R:: now that regrtest doesn't
always reload the module (specifically, it doesn't reload if the module has a 'test_main'.)
This commit is contained in:
parent
993633c6f2
commit
767833dc22
1 changed files with 4 additions and 4 deletions
|
|
@ -82,11 +82,11 @@ class TestModule(unittest.TestCase):
|
|||
self.assertEqual(msg.category, 'UserWarning')
|
||||
|
||||
def test_main(verbose=None):
|
||||
# Obscure hack so that this test passes after reloads or repeated calls
|
||||
# to test_main (regrtest -R).
|
||||
if '__warningregistry__' in globals():
|
||||
del globals()['__warningregistry__']
|
||||
test_support.run_unittest(TestModule)
|
||||
|
||||
# Obscure hack so that this test passes after reloads (regrtest -R).
|
||||
if '__warningregistry__' in globals():
|
||||
del globals()['__warningregistry__']
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main(verbose=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue