summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2009-04-22 16:13:36 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2009-04-22 16:13:36 (GMT)
commit4738470402eff47379672a45fa5eb447461b38a0 (patch)
treed3005b480b6ecfd432d264e1526d5419c50c2938 /Lib/test/test_warnings.py
parentae9b6ad91ea3bf561c8d0d222f3e1df85baeedea (diff)
downloadcpython-4738470402eff47379672a45fa5eb447461b38a0.zip
cpython-4738470402eff47379672a45fa5eb447461b38a0.tar.gz
cpython-4738470402eff47379672a45fa5eb447461b38a0.tar.bz2
Merged revisions 71799 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71799 | nick.coghlan | 2009-04-23 01:26:04 +1000 (Thu, 23 Apr 2009) | 1 line Issue 5354: Change API for import_fresh_module() to better support test_warnings use case (also fixes some bugs in the original implementation) ........
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r--Lib/test/test_warnings.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 1f377ad..4bcc210 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -10,14 +10,8 @@ from test import warning_tests
import warnings as original_warnings
-py_warnings = support.import_fresh_module('warnings', ['_warnings'])
-# XXX (ncoghlan 20090412):
-# Something in Py3k doesn't like sharing the same instance of
-# _warnings between original_warnings and c_warnings
-# Will leave issue 5354 open until I understand why 3.x breaks
-# without the next line, while 2.x doesn't care
-del sys.modules['_warnings']
-c_warnings = support.import_fresh_module('warnings')
+py_warnings = support.import_fresh_module('warnings', blocked=['_warnings'])
+c_warnings = support.import_fresh_module('warnings', fresh=['_warnings'])
@contextmanager
def warnings_state(module):