#16306: merge with 3.3.

This commit is contained in:
Ezio Melotti 2012-11-18 14:06:54 +02:00
commit 195ad6ce05
4 changed files with 17 additions and 6 deletions

View file

@ -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()