Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Truncation threshold at different verbosity levels #8403

Description

@nicoddemus

Currently pytest always truncates any output string when displaying assertion errors to 240 characters (it is hardcoded in saferepr). This is often a problem, specially in CI (#6682).

#8391 changes how verbosity affects truncation of assertion output, like this:

Verbosity Max chars
0 240
1 240
2 240
3 2400
4+ No limit

The intent here was to keep the normal -v and -vv (the more common verbosity levels) unchanged, however I have been thinking that perhaps it makes more sense to increase the threshold starting right with -v, like this:

Verbosity Max chars
0 240
1 2400
2+ No limit

Thoughts?

The logic is that one who is increasing verbosity already expects more output anyway, so it makes sense to increase the threshold limit as well.

cc @ssbarnea

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstopic: tracebacksrelated to displaying and handling of tracebackstype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions