Skip to content

Live logger error before 'when' is set #3184

@uSpike

Description

@uSpike

Hi,

The live logger _LiveLoggingStreamHandler will emit messages in emit():

self.stream.section('live log ' + self._when, sep='-', bold=True)

If self._when is None, which may be the case before a test is actually started, this will raise an exception:

TypeError: cannot concatenate 'str' and 'NoneType' objects

I ran into this issue with a plugin I created which emits log messages before the first test starts. It's a pretty simple fix which I'm fine creating a PR for, but what should the text be if self._when is None?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions