Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live logger error before 'when' is set #3184

Closed
uSpike opened this issue Feb 1, 2018 · 4 comments
Closed

Live logger error before 'when' is set #3184

uSpike opened this issue Feb 1, 2018 · 4 comments
Labels
type: bug problem that needs to be addressed

Comments

@uSpike
Copy link
Member

uSpike commented Feb 1, 2018

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?

@nicoddemus nicoddemus added type: bug problem that needs to be addressed plugin: logging related to the logging builtin plugin labels Feb 1, 2018
@pytestbot pytestbot removed the plugin: logging related to the logging builtin plugin label Feb 1, 2018
@nicoddemus
Copy link
Member

Hi @uSpike, thanks for the report. I believe #3175, already fixes this though, can you give that branch a try?

@uSpike
Copy link
Member Author

uSpike commented Feb 1, 2018

@nicoddemus it does seem that #3175 fixes the issue, thanks for linking me to that.

@uSpike uSpike closed this as completed Feb 1, 2018
@nicoddemus nicoddemus mentioned this issue Feb 1, 2018
4 tasks
@nicoddemus
Copy link
Member

Thanks, but lets keep this open because we don't have an issue to track this bug anyway. 👍

@nicoddemus nicoddemus reopened this Feb 1, 2018
@s0undt3ch
Copy link
Contributor

#3188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

4 participants