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.
1 parent 48e3559 commit cd389f5Copy full SHA for cd389f5
1 file changed
Lib/test/test_platform.py
@@ -757,9 +757,11 @@ def invoke_platform(self, *flags):
757
758
def test_unknown_flag(self):
759
with self.assertRaises(SystemExit):
760
+ output = io.StringIO()
761
# suppress argparse error message
- with contextlib.redirect_stderr(io.StringIO()):
762
+ with contextlib.redirect_stderr(output):
763
_ = self.invoke_platform('--unknown')
764
+ self.assertStartsWith(output, "usage: ")
765
766
def test_invocation(self):
767
flags = (
@@ -800,7 +802,7 @@ def test_help(self):
800
802
with contextlib.redirect_stdout(output):
801
803
platform._main(args=["--help"])
804
- self.assertIn("usage:", output.getvalue())
805
+ self.assertStartsWith(output.getvalue(), "usage:")
806
807
808
if __name__ == '__main__':
0 commit comments