diff options
author | Brett Cannon <brett@python.org> | 2013-06-16 19:20:48 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-16 19:20:48 (GMT) |
commit | 6d26eba186655be245af90c4a7c2aec6a1e14fc6 (patch) | |
tree | 6c8e9be5286c1e2d2663e9d3fbdc8713563fcdc0 /Lib | |
parent | 13d8ff9c5bc6c957696e9e25e54a02fc077af1af (diff) | |
download | cpython-6d26eba186655be245af90c4a7c2aec6a1e14fc6.zip cpython-6d26eba186655be245af90c4a7c2aec6a1e14fc6.tar.gz cpython-6d26eba186655be245af90c4a7c2aec6a1e14fc6.tar.bz2 |
Check that warnings.showwarning() is not changed.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/test/regrtest.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 7602b2b..b3ba33f 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1062,7 +1062,7 @@ class saved_test_environment: '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 @@ class saved_test_environment: 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('.', '_') |