Merged revisions 78815 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78815 | florent.xicluna | 2010-03-09 21:57:01 +0200 (Tue, 09 Mar 2010) | 2 lines

  #7772: Fix test_py3kwarn. Now the test suite could pass with "-3" flag.
........
This commit is contained in:
Ezio Melotti 2010-08-02 21:48:39 +00:00
parent 51449f5346
commit f9c2f4f399
2 changed files with 30 additions and 13 deletions

View file

@ -437,10 +437,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]