summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-09 19:57:01 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-09 19:57:01 (GMT)
commit4d42f2b4d1287f369295be206d962d86a3a0cb25 (patch)
tree921794b8e68eeaad1e14df96b08624170f5eb69f /Lib/test/test_support.py
parente30bc38ce9bfeeac052a69833e94a36b149b6499 (diff)
downloadcpython-4d42f2b4d1287f369295be206d962d86a3a0cb25.zip
cpython-4d42f2b4d1287f369295be206d962d86a3a0cb25.tar.gz
cpython-4d42f2b4d1287f369295be206d962d86a3a0cb25.tar.bz2
#7772: Fix test_py3kwarn. Now the test suite could pass with "-3" flag.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py8
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]