Skip to content

Provide a session.normalized_name beside session.friendly_name #996

@jrast

Description

@jrast

How would this feature be useful?

The session provides a friendly_name property, however, this is often not a filesystem friendly name which is often required for test outputs like coverage files or junit reports. I propose an additional normalized_name property which returns a name which can be used in filenames.

Describe the solution you'd like

The easiest way would probably be something like this:

@property
def normalized_name(self):
    return _normalize_path('', self.friendly_name)

I did not check the behavior of _normalize_path exactly and how it behaves if the path argument is a empty string.

Describe alternatives you've considered

Currently I either do some normalization on my own or use Path(session.virtualenv.location).name to get the normalized name

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions