Skip to content
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

gh-106368: Increase Argument Clinic CLI test coverage #107277

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jul 25, 2023

  • Add test case for directory traversal

  • Add test cases for invalid CLI option combinations.

- Add test case for directory traversal

- Add test cases for invalid CLI option combinations.
@erlend-aasland
Copy link
Contributor Author

With this PR, we're up in 88% coverage.

self.assertIn(msg, out)

def test_cli_fail_filename_or_output_and_make(self):
for opts in ("-o", "out.c"), ("filename.c",):
Copy link
Member

Choose a reason for hiding this comment

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

Style nit:

Suggested change
for opts in ("-o", "out.c"), ("filename.c",):
for opts in [("-o", "out.c"), ("filename.c",)]:

For me, this is much more readable.

@erlend-aasland erlend-aasland merged commit 579100f into python:main Jul 26, 2023
25 checks passed
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@erlend-aasland erlend-aasland deleted the clinic/more-cli-coverage branch July 26, 2023 06:34
@miss-islington
Copy link
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 579100f6d75a27429e7f8de74935d7bc3a3e44e6 3.11

@bedevere-bot
Copy link

GH-107282 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 26, 2023
…-107277)

(cherry picked from commit 579100f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Jul 26, 2023
@erlend-aasland
Copy link
Contributor Author

Thanks for the review!

erlend-aasland added a commit that referenced this pull request Jul 26, 2023
…) (#107282)

(cherry picked from commit 579100f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
@erlend-aasland erlend-aasland added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels Jul 26, 2023
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @erlend-aasland, I had trouble checking out the 3.11 backport branch.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 579100f6d75a27429e7f8de74935d7bc3a3e44e6 3.11

@bedevere-bot
Copy link

GH-107326 is a backport of this pull request to the 3.11 branch.

erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request Jul 26, 2023
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 26, 2023
erlend-aasland added a commit that referenced this pull request Jul 26, 2023
jtcave pushed a commit to jtcave/cpython that referenced this pull request Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants