[Python-checkins] cpython: Check that warnings.showwarning() is not changed.

brett.cannon python-checkins at python.org
Sun Jun 16 21:20:55 CEST 2013


http://hg.python.org/cpython/rev/59a11c81dd3c
changeset:   84170:59a11c81dd3c
user:        Brett Cannon <brett at python.org>
date:        Sun Jun 16 15:20:48 2013 -0400
summary:
  Check that warnings.showwarning() is not changed.

files:
  Lib/test/regrtest.py |  7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1062,7 +1062,7 @@
                  'sys.warnoptions', 'threading._dangling',
                  'multiprocessing.process._dangling',
                  'sysconfig._CONFIG_VARS', 'sysconfig._INSTALL_SCHEMES',
-                 'support.TESTFN', 'locale',
+                 'support.TESTFN', 'locale', 'warnings.showwarning',
                 )
 
     def get_sys_argv(self):
@@ -1244,6 +1244,11 @@
         for lc, setting in saved:
             locale.setlocale(lc, setting)
 
+    def get_warnings_showwarning(self):
+        return warnings.showwarning
+    def restore_warnings_showwarning(self, fxn):
+        warnings.showwarning = fxn
+
     def resource_info(self):
         for name in self.resources:
             method_suffix = name.replace('.', '_')

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list