summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
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 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()