gh-131178: Add tests for profile module command-line interface - #158542
Draft
Nityahapani wants to merge 1 commit into
Draft
Nityahapani wants to merge 1 commit into
Nityahapani wants to merge 1 commit into
Conversation
Add a new `ProfileCLITest` class to `Lib/test/test_profile.py` with tests covering the full CLI surface of the `profile` module: - No arguments prints usage and exits with code 2 - `-h`/`--help` prints usage and exits with code 0 - Profiling a script file directly - `-m` flag to profile a library module - `-m` flag with a non-existent module (failure case) - `-o`/`--outfile` writes a valid pstats file - `-s`/`--sort` accepts a sort key without error - `-m` alone without a module name (failure case) Co-authored-by: Nityahapani <nityah@users.noreply.github.com>
|
The following commit authors need to sign the Contributor License Agreement: |
7 of 9 tasks
BHUVANSH855
reviewed
Oct 1, 2026
BHUVANSH855
left a comment
Contributor
There was a problem hiding this comment.
Sign CLA, so that maintainers can begin with review process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new
ProfileCLITestclass toLib/test/test_profile.pywith tests covering the full CLI surface of theprofilemodule:-h/--helpprints usage and exits with code 0-mflag to profile a library module-mflag with a non-existent module (failure case)-o/--outfilewrites a valid pstats file-s/--sortaccepts a sort key without error-malone without a module name (failure case)