Skip to content

Make "-" argument separator in parametrised test logs configurable #14201

@begoon

Description

@begoon

Improve readability of test running reports

pytest uses the - character to separate test parameter values in logs. There is no official API to change this string.

A hacky was is:

from _pytest.python import CallSpec2

def pytest_sessionstart(session: Session) -> None:

    def format_idlist(self: CallSpec2) -> str:
        return " | ".join(filter(None, self._idlist))

    setattr(CallSpec2, "id", property(format_idlist))

Describe the solution you'd like

It would be nice to have either a variable or callable somewhere in Session to change - to any string, like |, for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions