-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
The NORMALIZE_WHITESPACE option allows to split long output into multiple lines but this doesn't work with strings that do not have whitespaces. For instance:
>>> ok = "foo bar"
>>> ok # doctest: +NORMALIZE_WHITESPACE
'foo
bar'
>>> fail = "foobar"
>>> fail # doctest: +NORMALIZE_WHITESPACE
'foo
bar'
I suggest adding an option to handle very long strings (I don't think we should extend NORMALIZE_WHITESPACE as someone might want the new line in the output to match a whitespace). It would be possible to use +ELLIPSIS
but sometimes I find myself wanting to match the entire string (e.g., when the output is deterministic but looks random).
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement