pytest-dev/pytest-reportlog

remove ANSI escape sequences from the report messages

开放

#83 创建于 2025年9月14日

 (5 条评论) (0 个反应) (0 位负责人)Python (23 个派生)auto 404
enhancementgood first issuehelp wanted

仓库指标

星标
 (104 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

pytest has somewhat recently added support for coloring diffs of builtin structures like list or dict, which makes ANSI escape sequences appear in the messages pytest-reportlog writes to the log file.

Since that log file is intended to be machine-readable, I think reportlog should either strip the escape sequences from error messages, or pytest should add colors after the execution of the hook that reportlog registers to. I'd guess the former to be more realistic since I'd expect modifying pytest to that effect to be really tricky.

贡献者指南