diff options
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r-- | Lib/test/test_support.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 8f66933..c8aed4e 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -519,10 +519,10 @@ def _filterwarnings(filters, quiet=False): if registry: registry.clear() with warnings.catch_warnings(record=True) as w: - # Disable filters, to record all warnings. Because - # test_warnings swap the module, we need to look up - # in the sys.modules dictionary. - sys.modules['warnings'].resetwarnings() + # Set filter "always" to record all warnings. Because + # test_warnings swap the module, we need to look up in + # the sys.modules dictionary. + sys.modules['warnings'].simplefilter("always") yield WarningsRecorder(w) # Filter the recorded warnings reraise = [warning.message for warning in w] |