From 0e83511d6d6fa0f6619df8a17b7c04de8e21acba Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Tue, 26 Sep 2017 23:34:54 +0200 Subject: [PATCH] Rename name of registered logging plugin --- _pytest/logging.py | 3 ++- testing/logging/test_reporting.py | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/_pytest/logging.py b/_pytest/logging.py index 76d5be34b..1b71a544e 100644 --- a/_pytest/logging.py +++ b/_pytest/logging.py @@ -240,7 +240,8 @@ def get_actual_log_level(config, *setting_names): def pytest_configure(config): - config.pluginmanager.register(LoggingPlugin(config), 'loggingp') + config.pluginmanager.register(LoggingPlugin(config), + 'logging-plugin') class LoggingPlugin(object): diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index af75eb632..c02ee2172 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -147,7 +147,7 @@ def test_log_cli_default_level(testdir): import pytest import logging def test_log_cli(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_cli_handler.level == logging.WARNING logging.getLogger('catchlog').info("This log message won't be shown") logging.getLogger('catchlog').warning("This log message will be shown") @@ -180,7 +180,7 @@ def test_log_cli_level(testdir): import pytest import logging def test_log_cli(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_cli_handler.level == logging.INFO logging.getLogger('catchlog').debug("This log message won't be shown") logging.getLogger('catchlog').info("This log message will be shown") @@ -236,7 +236,7 @@ def test_log_cli_ini_level(testdir): import pytest import logging def test_log_cli(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_cli_handler.level == logging.INFO logging.getLogger('catchlog').debug("This log message won't be shown") logging.getLogger('catchlog').info("This log message will be shown") @@ -269,7 +269,7 @@ def test_log_file_cli(testdir): import pytest import logging def test_log_file(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_file_handler.level == logging.WARNING logging.getLogger('catchlog').info("This log message won't be shown") logging.getLogger('catchlog').warning("This log message will be shown") @@ -300,7 +300,7 @@ def test_log_file_cli_level(testdir): import pytest import logging def test_log_file(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_file_handler.level == logging.INFO logging.getLogger('catchlog').debug("This log message won't be shown") logging.getLogger('catchlog').info("This log message will be shown") @@ -339,7 +339,7 @@ def test_log_file_ini(testdir): import pytest import logging def test_log_file(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_file_handler.level == logging.WARNING logging.getLogger('catchlog').info("This log message won't be shown") logging.getLogger('catchlog').warning("This log message will be shown") @@ -375,7 +375,7 @@ def test_log_file_ini_level(testdir): import pytest import logging def test_log_file(request): - plugin = request.config.pluginmanager.getplugin('loggingp') + plugin = request.config.pluginmanager.getplugin('logging-plugin') assert plugin.log_file_handler.level == logging.INFO logging.getLogger('catchlog').debug("This log message won't be shown") logging.getLogger('catchlog').info("This log message will be shown")