mirror of
https://github.com/python/cpython.git
synced 2025-10-19 05:08:28 +00:00
Add a check for sys.warnoptions in regrtest.
This commit is contained in:
parent
bec7886e3f
commit
0123e055fa
1 changed files with 8 additions and 1 deletions
|
@ -827,7 +827,8 @@ class saved_test_environment:
|
||||||
resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
|
resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
|
||||||
'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
|
'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
|
||||||
'warnings.filters', 'asyncore.socket_map',
|
'warnings.filters', 'asyncore.socket_map',
|
||||||
'logging._handlers', 'logging._handlerList')
|
'logging._handlers', 'logging._handlerList',
|
||||||
|
'sys.warnoptions')
|
||||||
|
|
||||||
def get_sys_argv(self):
|
def get_sys_argv(self):
|
||||||
return id(sys.argv), sys.argv, sys.argv[:]
|
return id(sys.argv), sys.argv, sys.argv[:]
|
||||||
|
@ -909,6 +910,12 @@ class saved_test_environment:
|
||||||
# Can't easily revert the logging state
|
# Can't easily revert the logging state
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_sys_warnoptions(self):
|
||||||
|
return id(sys.warnoptions), sys.warnoptions, sys.warnoptions[:]
|
||||||
|
def restore_sys_warnoptions(self, saved_options):
|
||||||
|
sys.warnoptions = saved_options[1]
|
||||||
|
sys.warnoptions[:] = saved_options[2]
|
||||||
|
|
||||||
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…
Add table
Add a link
Reference in a new issue