Skip to content

No color output when specifying log format string with precision-formatted levelname #8548

@lolyu

Description

@lolyu

Pytest fails to output colorfully with the following log format string in pytest.ini

log_cli_format: %(asctime)s %(funcNamewithModule)-40.40s L%(lineno)-.4d %(levelname)-5.5s| %(message)s

This is due to ColoredLevelFormatter.LEVELNAME_FMT_REGEX fails to match the format string due to the presence of precision bit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions