pprint tests do not test pprint.pprint() #89722
Copy link
Copy link
Open
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
| BPO | 45559 |
|---|---|
| Nosy | @ericvsmith, @hp310780 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2021-10-21.20:23:04.931>
labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
title = 'pprint tests do not test pprint.pprint()'
updated_at = <Date 2022-02-18.15:18:17.383>
user = 'https://github.com/ericvsmith'bugs.python.org fields:
activity = <Date 2022-02-18.15:18:17.383>
actor = 'eric.smith'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-10-21.20:23:04.931>
creator = 'eric.smith'
dependencies = []
files = []
hgrepos = []
issue_num = 45559
keywords = []
message_count = 3.0
messages = ['404647', '413484', '413486']
nosy_count = 2.0
nosy_names = ['eric.smith', 'hp310780']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45559'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
ericvsmith commentedon Oct 21, 2021
For example, see bpo-45557, where pprint.pformat(underscore_numbers=True) worked, but pprint.pprint(underscore_numbers=True) did not.
Testing of pprint.pprint() should be added.
[-]pprint module does not test pprint.pprint()[/-][+]pprint tests do not test pprint.pprint()[/+][-]pprint module does not test pprint.pprint()[/-][+]pprint tests do not test pprint.pprint()[/+]hp310780 commentedon Feb 18, 2022
ericvsmith commentedon Feb 18, 2022
Sure, have a go at it!
Any testing of pprint.pprint() would be an improvement, but ideally all options should be tested.
It would probably be worthwhile to restructure the tests to run both pformat and pprint tests from the same logic, so that we only need to change one thing if new options are added. I haven't looked at the tests, so I'm not sure how much work this would be.
pythongh-89722: Add pprint.pprint tests for indent, width and depth a…
pythongh-89722: Add pprint.pprint tests for compact, sort_dict and un…
hp310780 commentedon Jul 26, 2022
hp310780 commentedon Aug 5, 2022