summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-03-20 13:09:26 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2011-03-20 13:09:26 (GMT)
commit0123e055fa50c067fc66599694f2f1df3fe61b0e (patch)
treee699443f37c9da057687ea4ca63f3caaa0b2a739 /Lib/test/regrtest.py
parentbec7886e3fef5ac751727c05248edc0a394781b9 (diff)
downloadcpython-0123e055fa50c067fc66599694f2f1df3fe61b0e.zip
cpython-0123e055fa50c067fc66599694f2f1df3fe61b0e.tar.gz
cpython-0123e055fa50c067fc66599694f2f1df3fe61b0e.tar.bz2
Add a check for sys.warnoptions in regrtest.
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index b5288b5..440c09c 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -827,7 +827,8 @@ class saved_test_environment:
resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
'warnings.filters', 'asyncore.socket_map',
- 'logging._handlers', 'logging._handlerList')
+ 'logging._handlers', 'logging._handlerList',
+ 'sys.warnoptions')
def get_sys_argv(self):
return id(sys.argv), sys.argv, sys.argv[:]
@@ -909,6 +910,12 @@ class saved_test_environment:
# Can't easily revert the logging state
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):
for name in self.resources:
method_suffix = name.replace('.', '_')