From f5d9e967efae5f0b52055df00be6360d337e1953 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 9 Sep 2015 07:13:56 +0200 Subject: [PATCH] logfail: Rename capturelog module. When trying to use this as conftest for the updated tests, pytest_* would be interpreted as hook otherwise. --- tests/helpers/logfail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/helpers/logfail.py b/tests/helpers/logfail.py index e3b619645..dc70f4e29 100644 --- a/tests/helpers/logfail.py +++ b/tests/helpers/logfail.py @@ -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)