summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-18 12:06:54 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-18 12:06:54 (GMT)
commit195ad6ce052bfdda8f47ffbf14becb95253bafc6 (patch)
treec0f490b174554b01c026004656614852064a11ba /Lib/test/test_cmd_line.py
parent6654de69b2ac20651c708eb3183b61c03624a018 (diff)
parentf7c709d62d09ef91b335ac7c262f0079713846a1 (diff)
downloadcpython-195ad6ce052bfdda8f47ffbf14becb95253bafc6.zip
cpython-195ad6ce052bfdda8f47ffbf14becb95253bafc6.tar.gz
cpython-195ad6ce052bfdda8f47ffbf14becb95253bafc6.tar.bz2
#16306: merge with 3.3.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 7a10288..a4b2508 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -7,7 +7,8 @@ import os
import sys
import subprocess
import tempfile
-from test.script_helper import spawn_python, kill_python, assert_python_ok, assert_python_failure
+from test.script_helper import (spawn_python, kill_python, assert_python_ok,
+ assert_python_failure)
# XXX (ncoghlan): Move to script_helper and make consistent with run_python
@@ -387,6 +388,12 @@ class CmdLineTest(unittest.TestCase):
assert_python_ok(filename)
+ def test_unknown_options(self):
+ rc, out, err = assert_python_failure('-z', __cleanenv=True)
+ self.assertIn(b'Unknown option', err)
+ self.assertEqual(err.splitlines().count(b'Unknown option: -z'), 1)
+ self.assertEqual(b'', out)
+
def test_main():
test.support.run_unittest(CmdLineTest)
test.support.reap_children()