Skip to content

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

@Ar-maan05

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.

@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label May 15, 2026
@Ar-maan05

Copy link
Copy Markdown
Contributor Author

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

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Aug 30, 2026
Cover error paths (invalid JSON input, missing input file, unknown and mutually exclusive options) and --json-lines combined with --compact or --no-indent.
@Ar-maan05
Ar-maan05 force-pushed the gh-131178-json-cli-tests branch from a9d3e40 to 2be1598 Compare August 31, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stale Stale PR or inactive for long period of time. tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant