Skip to content

gh-131178: Fix test_unknown_flag for platform CLI #137816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Aug 15, 2025

@bedevere-app bedevere-app bot added awaiting review tests Tests in the Lib/test dir labels Aug 15, 2025
@donBarbos
Copy link
Contributor Author

cc @AA-Turner Bénédikt suggested ping you for this PR, could you review?

Comment on lines 768 to -771
with self.assertRaises(SystemExit):
output = io.StringIO()
# suppress argparse error message
with contextlib.redirect_stderr(output):
_ = self.invoke_platform('--unknown')
self.assertStartsWith(output, "usage: ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relevant issue is that self.assertStartsWith will ordinarily never be called due to the SystemExit.

@donBarbos in the future, please explain and provide context for your PRs, rather than just saying 'fix' -- assume reviewers are looking at your proposed changes with no prior context.

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants