diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-18 12:02:08 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-18 12:02:08 (GMT) |
commit | f7c709d62d09ef91b335ac7c262f0079713846a1 (patch) | |
tree | 80776c9bc8ee22c5453bd43465dc967960195eb1 /Lib/test/test_cmd_line.py | |
parent | 0e1c8166a467c9fc3cd87c82efab16bdf90c21d0 (diff) | |
parent | 7c66319edcbeb3d1590e1c2397efea3171623be2 (diff) | |
download | cpython-f7c709d62d09ef91b335ac7c262f0079713846a1.zip cpython-f7c709d62d09ef91b335ac7c262f0079713846a1.tar.gz cpython-f7c709d62d09ef91b335ac7c262f0079713846a1.tar.bz2 |
#16306: merge with 3.2.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index f617c2f..d8798cf 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 @@ -370,6 +371,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() |