mirror of https://github.com/python/cpython
Check that warnings.showwarning() is not changed.
This commit is contained in:
parent
13d8ff9c5b
commit
6d26eba186
|
@ -1062,7 +1062,7 @@ class saved_test_environment:
|
||||||
'sys.warnoptions', 'threading._dangling',
|
'sys.warnoptions', 'threading._dangling',
|
||||||
'multiprocessing.process._dangling',
|
'multiprocessing.process._dangling',
|
||||||
'sysconfig._CONFIG_VARS', 'sysconfig._INSTALL_SCHEMES',
|
'sysconfig._CONFIG_VARS', 'sysconfig._INSTALL_SCHEMES',
|
||||||
'support.TESTFN', 'locale',
|
'support.TESTFN', 'locale', 'warnings.showwarning',
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_sys_argv(self):
|
def get_sys_argv(self):
|
||||||
|
@ -1244,6 +1244,11 @@ class saved_test_environment:
|
||||||
for lc, setting in saved:
|
for lc, setting in saved:
|
||||||
locale.setlocale(lc, setting)
|
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):
|
def resource_info(self):
|
||||||
for name in self.resources:
|
for name in self.resources:
|
||||||
method_suffix = name.replace('.', '_')
|
method_suffix = name.replace('.', '_')
|
||||||
|
|
Loading…
Reference in New Issue