-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Description
While working on #130160 and #93096 it was decided that it would be worth paying attention to the problem of lack of tests for command line interface.
List of all cli modules is in the documentation: https://docs.python.org/dev/library/cmdline.html
Many modules are missing command line interface tests, so I suggest using this issue to submit PRs for now only for well-documented interfaces, for example:
-
tokenize(gh-131178: Add tests fortokenizecommand-line interface #131274) -
platform(gh-131524: Update platform CLI to use argparse #131542) -
pickle(gh-131178: Add tests forpicklecommand-line interface #131275) -
ast(gh-131178: Add tests forastcommand-line interface #133329) -
pickletools(gh-131178: Add tests forpickletoolscommand-line interface #131287) -
http.server(gh-131178: Add tests for http.server command-line interface #132540) -
profile(gh-131178: Add CLI tests for profile module #134103) -
cProfile(gh-131178: Add CLI tests for cProfile #134269) -
site( gh-131178: Add tests forsitecommand-line interface #133582)
TODO: Make sure all documented have tests for CLI (others are not so important as it has not been decided what to do with them yet)
You can use PR #127759 for dis module or #118132 for random module as a reference.
And I also suggest using subprocess.Popen to allocate a separate resource since some modules can block a lot of time.
Important
For those who want to work on the issue, please:
- Select one module for which tests will be improved. It's easier to review and backport.
- Open a pull request with the following title:
gh-131178: Add tests for `MODULE_NAME` command-line interface
Linked PRs
- gh-131178: Add tests for
tokenizecommand-line interface #131274 - gh-131178: Add tests for
picklecommand-line interface #131275 - gh-131178: Add tests for
pickletoolscommand-line interface #131287 - gh-131178: Update help message for
timeitCLI #131326 - gh-131178: Add tests for http.server command-line interface #132540
- gh-131178: Add tests for
astcommand-line interface #133329 - gh-131178: Add tests for
sitecommand-line interface #133582 - gh-131178: Add CLI tests for profile module #134103
- gh-131178: fix SSL tests for
http.servercommand-line interface #134224 - gh-131178: Add CLI tests for cProfile #134269
- gh-131178: add E2E mockless tests for
http.servercommand-line interface #134279 - gh-131178: remove runtime tests for
http.serverCLI #134287 - gh-131178: Use
support.captured_stdoutandsupport.captured_stderr#137748 - gh-131178: Add tests for site command-line interface #137807
- gh-131178: Fix
test_unknown_flagfor platform CLI #137816 - [3.14] gh-131178: Add tests for
sitecommand-line interface (GH-133582) #137832 - [3.13] gh-131178: Add tests for
sitecommand-line interface (GH-133582) #137833 - gh-131178: Add tests for
sysconfigcommand-line interface #139934 - gh-131178: add tests for
filecmpcommand-line interface #139947 - gh-131178: add unittest for turtledemo #139983
- gh-131178: add tests for filecmp command-line interface #140199
- gh-131178: add tests for filecmp command-line interface #140200