FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131178: Add more tests for json command-line interface by Ar-maan05 · Pull Request #149868 · python/cpython · GitHub

/ cpython Public

gh-131178: Add more tests for json command-line interface - #149868

Open
Ar-maan05 wants to merge 1 commit into
python:mainfrom
Ar-maan05:gh-131178-json-cli-tests
Open

gh-131178: Add more tests for json command-line interface#149868
Ar-maan05 wants to merge 1 commit into
python:mainfrom
Ar-maan05:gh-131178-json-cli-tests

Conversation

Copy link
Copy Markdown
Contributor

Adds tests for previously-uncovered paths of the json / json.tool CLI:

  • invalid JSON input on stdin
  • empty stdin input
  • missing input file
  • unknown CLI option
  • --indent + --tab (mutually exclusive)
  • --compact + --no-indent (mutually exclusive)
  • --json-lines + --compact (valid JSONL output)
  • --json-lines + --no-indent (valid JSONL output)
  • invalid line inside --json-lines mode

All tests inherit through TestTool(TestMain) so they run for both
python -m json and python -m json.tool.

Cover error paths (invalid JSON input, missing input file, unknown and mutually exclusive options) and --json-lines combined with --compact or --no-indent.
bedevere-app Bot added the tests Tests in the Lib/test dir label May 15, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping! Let me know if any changes are needed.

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

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL