restore the logging plugin only if it was active to begin with

This commit is contained in:
Camilo 2017-12-14 09:40:34 -05:00
parent e30c39fe78
commit 33fa580947
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ def reset_logging(monkeypatch):
logger.handlers = []
logger.setLevel(logging.NOTSET)
pytest.config.pluginmanager.register(logging_plugin, 'logging-plugin')
if logging_plugin:
pytest.config.pluginmanager.register(logging_plugin, 'logging-plugin')
def test_logger(app):