Skip to content

Ability to choose syntax highlighting style by configuration #7132

@azmeuk

Description

@azmeuk

This issue is somewhat related to #6906.
Syntax highlighting is a great feature that I have been waiting for a long time. Thank you for that!
However, the pygment style that is used by default does not really match my terminal color configuration. Colors have poor contrast, and in the end, I cannot really benefit from syntax highlighting.

I would love to be able to choose the pygments theme from CLI options, or in a configuration file.

Another idea would be to configure the pygments theme with environment variables. This is because, pytest configuration generally depends on the project you are testing, and the configuration file is shipped in the project repository. However colors configuration will be dependent on the developper setup and should probably better remain unversioned. Environment variables allows that.

terminal

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions