diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-09-06 06:49:15 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-09-06 06:49:15 -0700 |
commit | cdac5516750e3b80b846e0e156e496dd92be9b56 (patch) | |
tree | 5530922f0e4a08e12d99f3a94443c71fc89c8d12 /Lib/test/test_argparse.py | |
parent | 309836c5c8a7bf85c666ff913bf903b8f735cfa5 (diff) | |
download | cpython-git-cdac5516750e3b80b846e0e156e496dd92be9b56.tar.gz |
Issue #18920: argparse's default version action (for -v, --version) should
output to stdout, matching the 'python -v'
Reported by Wolfgang Maier
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r-- | Lib/test/test_argparse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index 00cde2ed5c..c10c5909bf 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -4359,7 +4359,7 @@ class TestOptionalsHelpVersionActions(TestCase): def test_version_format(self): parser = ErrorRaisingArgumentParser(prog='PPP') parser.add_argument('-v', '--version', action='version', version='%(prog)s 3.5') - msg = self._get_error(parser.parse_args, ['-v']).stderr + msg = self._get_error(parser.parse_args, ['-v']).stdout self.assertEqual('PPP 3.5\n', msg) def test_version_no_help(self): @@ -4372,7 +4372,7 @@ class TestOptionalsHelpVersionActions(TestCase): def test_version_action(self): parser = ErrorRaisingArgumentParser(prog='XXX') parser.add_argument('-V', action='version', version='%(prog)s 3.7') - msg = self._get_error(parser.parse_args, ['-V']).stderr + msg = self._get_error(parser.parse_args, ['-V']).stdout self.assertEqual('XXX 3.7\n', msg) def test_no_help(self): |