We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
test_unknown_flag
1 parent 75d20b2 commit b4cfc97Copy full SHA for b4cfc97
Lib/test/test_platform.py
@@ -763,12 +763,12 @@ def invoke_platform(self, *flags):
763
return output.getvalue()
764
765
def test_unknown_flag(self):
766
+ output = io.StringIO()
767
with self.assertRaises(SystemExit):
- output = io.StringIO()
768
# suppress argparse error message
769
with contextlib.redirect_stderr(output):
770
_ = self.invoke_platform('--unknown')
771
- self.assertStartsWith(output, "usage: ")
+ self.assertStartsWith(output.getvalue(), "usage: ")
772
773
def test_invocation(self):
774
flags = (
0 commit comments