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 ed53c63 commit e76464dCopy full SHA for e76464d
Lib/test/test_platform.py
@@ -770,13 +770,14 @@ def invoke_platform(self, *flags):
770
platform._main(args=flags)
771
return output.getvalue()
772
773
+ @support.force_not_colorized
774
def test_unknown_flag(self):
775
+ output = io.StringIO()
776
with self.assertRaises(SystemExit):
- output = io.StringIO()
777
# suppress argparse error message
778
with contextlib.redirect_stderr(output):
779
_ = self.invoke_platform('--unknown')
- self.assertStartsWith(output, "usage: ")
780
+ self.assertStartsWith(output.getvalue(), "usage: ")
781
782
def test_invocation(self):
783
flags = (
0 commit comments