summaryrefslogtreecommitdiffstats
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2011-03-15 20:03:09 (GMT)
committerBrett Cannon <brett@python.org>2011-03-15 20:03:09 (GMT)
commitb880c1558e8562351e75837e1ba2932ae5d17111 (patch)
tree9efd54834bc3964e72037f9d6ef3e35e1f575367 /Lib/test/support.py
parentd47af531266000a3e22f36ba4ce83dbfb5c0362b (diff)
downloadcpython-b880c1558e8562351e75837e1ba2932ae5d17111.zip
cpython-b880c1558e8562351e75837e1ba2932ae5d17111.tar.gz
cpython-b880c1558e8562351e75837e1ba2932ae5d17111.tar.bz2
Add warnings support to test.support.args_from_interpreter_flags().
This allows the -j flag to regrtest to propagate warnings settings properly.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 53c2956..f5a53ca 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1374,7 +1374,7 @@ def strip_python_stderr(stderr):
def args_from_interpreter_flags():
"""Return a list of command-line arguments reproducing the current
- settings in sys.flags."""
+ settings in sys.flags and sys.warnoptions."""
flag_opt_map = {
'bytes_warning': 'b',
'dont_write_bytecode': 'B',
@@ -1389,6 +1389,9 @@ def args_from_interpreter_flags():
v = getattr(sys.flags, flag)
if v > 0:
args.append('-' + opt * v)
+ if sys.warnoptions:
+ args.append('-W')
+ args.extend(sys.warnoptions)
return args
#============================================================