Skip to content

Commit 416e0b2

Browse files
committed
gh-131178: Fix test_unknown_flag for platform CLI
1 parent 75d20b2 commit 416e0b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_platform.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,13 +762,14 @@ def invoke_platform(self, *flags):
762762
platform._main(args=flags)
763763
return output.getvalue()
764764

765+
@support.force_not_colorized
765766
def test_unknown_flag(self):
767+
output = io.StringIO()
766768
with self.assertRaises(SystemExit):
767-
output = io.StringIO()
768769
# suppress argparse error message
769770
with contextlib.redirect_stderr(output):
770771
_ = self.invoke_platform('--unknown')
771-
self.assertStartsWith(output, "usage: ")
772+
self.assertStartsWith(output.getvalue(), "usage: ")
772773

773774
def test_invocation(self):
774775
flags = (

0 commit comments

Comments
 (0)