pytest-dev/pytest-reportlog

remove ANSI escape sequences from the report messages

Ouverte

#83 ouverte le 14 sept. 2025

 (5 commentaires) (0 réaction) (0 personne assignée)Python (23 forks)auto 404
enhancementgood first issuehelp wanted

Métriques du dépôt

Stars
 (104 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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.

Guide contributeur