We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
test_unknown_flag
1 parent 75d20b2 commit 416e0b2Copy full SHA for 416e0b2
Lib/test/test_platform.py
@@ -762,13 +762,14 @@ def invoke_platform(self, *flags):
762
platform._main(args=flags)
763
return output.getvalue()
764
765
+ @support.force_not_colorized
766
def test_unknown_flag(self):
767
+ output = io.StringIO()
768
with self.assertRaises(SystemExit):
- output = io.StringIO()
769
# suppress argparse error message
770
with contextlib.redirect_stderr(output):
771
_ = self.invoke_platform('--unknown')
- self.assertStartsWith(output, "usage: ")
772
+ self.assertStartsWith(output.getvalue(), "usage: ")
773
774
def test_invocation(self):
775
flags = (
0 commit comments