mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-131178: Fix test_unknown_flag for platform CLI (#137816)
This commit is contained in:
parent
ed53c63769
commit
e76464d161
1 changed files with 3 additions and 2 deletions
|
|
@ -770,13 +770,14 @@ def invoke_platform(self, *flags):
|
|||
platform._main(args=flags)
|
||||
return output.getvalue()
|
||||
|
||||
@support.force_not_colorized
|
||||
def test_unknown_flag(self):
|
||||
output = io.StringIO()
|
||||
with self.assertRaises(SystemExit):
|
||||
output = io.StringIO()
|
||||
# suppress argparse error message
|
||||
with contextlib.redirect_stderr(output):
|
||||
_ = self.invoke_platform('--unknown')
|
||||
self.assertStartsWith(output, "usage: ")
|
||||
self.assertStartsWith(output.getvalue(), "usage: ")
|
||||
|
||||
def test_invocation(self):
|
||||
flags = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue