logfail: Rename capturelog module.
When trying to use this as conftest for the updated tests, pytest_* would be interpreted as hook otherwise.
This commit is contained in:
parent
376edd739b
commit
f5d9e967ef
@ -24,7 +24,7 @@ import logging
|
||||
import pytest
|
||||
|
||||
try:
|
||||
import pytest_capturelog
|
||||
import pytest_capturelog as caplog_mod
|
||||
except ImportError:
|
||||
# When using pytest for pyflakes/pep8/..., the plugin won't be available
|
||||
# but conftest.py will still be loaded.
|
||||
@ -47,7 +47,7 @@ class LogFailHandler(logging.Handler):
|
||||
root_logger = logging.getLogger()
|
||||
|
||||
for h in root_logger.handlers:
|
||||
if isinstance(h, pytest_capturelog.CaptureLogHandler):
|
||||
if isinstance(h, caplog_mod.CaptureLogHandler):
|
||||
caplog_handler = h
|
||||
break
|
||||
else:
|
||||
@ -86,12 +86,12 @@ def caplog_bug_workaround(request):
|
||||
multiple CaptureLogHandlers.
|
||||
"""
|
||||
yield
|
||||
if pytest_capturelog is None:
|
||||
if caplog_mod is None:
|
||||
return
|
||||
|
||||
root_logger = logging.getLogger()
|
||||
caplog_handlers = [h for h in root_logger.handlers
|
||||
if isinstance(h, pytest_capturelog.CaptureLogHandler)]
|
||||
if isinstance(h, caplog_mod.CaptureLogHandler)]
|
||||
|
||||
for h in caplog_handlers:
|
||||
root_logger.removeHandler(h)
|
||||
|
Loading…
Reference in New Issue
Block a user