summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-03-15 20:08:05 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-03-15 20:08:05 (GMT)
commitffd1f483063834531b6105b6ba0b71e482a8d555 (patch)
treeb4ef4d7d9b4cf98eda4b8eb930484433da034080 /Lib
parent485119eb1e351f1f142a06275c6b3b3182c38bf4 (diff)
parentd3967d4ccaf50576b8d8976701ed52245d1a77d0 (diff)
downloadcpython-ffd1f483063834531b6105b6ba0b71e482a8d555.zip
cpython-ffd1f483063834531b6105b6ba0b71e482a8d555.tar.gz
cpython-ffd1f483063834531b6105b6ba0b71e482a8d555.tar.bz2
merge heads
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/support.py5
-rw-r--r--Lib/test/test_fileinput.py6
2 files changed, 7 insertions, 4 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
#============================================================
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index 7afb88c..27ceaf6 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -277,7 +277,7 @@ class FileInputTests(unittest.TestCase):
def test_empty_files_list_specified_to_constructor(self):
with FileInput(files=[]) as fi:
- self.assertEquals(fi._files, ('-',))
+ self.assertEqual(fi._files, ('-',))
def test__getitem__(self):
"""Tests invoking FileInput.__getitem__() with the current
@@ -298,7 +298,7 @@ class FileInputTests(unittest.TestCase):
with FileInput(files=[t]) as fi:
with self.assertRaises(RuntimeError) as cm:
fi[1]
- self.assertEquals(cm.exception.args, ("accessing lines out of order",))
+ self.assertEqual(cm.exception.args, ("accessing lines out of order",))
def test__getitem__eof(self):
"""Tests invoking FileInput.__getitem__() with the line number but at
@@ -308,7 +308,7 @@ class FileInputTests(unittest.TestCase):
with FileInput(files=[t]) as fi:
with self.assertRaises(IndexError) as cm:
fi[0]
- self.assertEquals(cm.exception.args, ("end of input reached",))
+ self.assertEqual(cm.exception.args, ("end of input reached",))
def test_nextfile_oserror_deleting_backup(self):
"""Tests invoking FileInput.nextfile() when the attempt to delete