Skip to content
Myr

use config fixture, get plugin via unregister

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 33fa580 · Browse files · 1 file+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−5 removed

  • tests:+5 added−5 removed

1 file+5 added−5 removed

modified:tests/test_logging.py+5 added-5 removed
7 unmodified lines
8 wsgi_errors_stream91011@pytest.fixture(autouse=True)12def reset_logging(monkeypatch):12def reset_logging(pytestconfig):13 root_handlers = logging.root.handlers[:]14 logging.root.handlers = []15 root_level = logging.root.level1617 logger = logging.getLogger('flask.app')18 logger.handlers = []19 logger.setLevel(logging.NOTSET)2020 logging_plugin = pytest.config.pluginmanager.getplugin('logging-plugin')21 pytest.config.pluginmanager.unregister(name='logging-plugin')22 logging.root.handlers = []21 logging_plugin = pytestconfig.pluginmanager.unregister(22 name='logging-plugin')2324 yield2526 logging.root.handlers[:] = root_handlers
2 unmodified lines
29 logger.handlers = []30 logger.setLevel(logging.NOTSET)3132 if logging_plugin:33 pytest.config.pluginmanager.register(logging_plugin, 'logging-plugin')33 pytestconfig.pluginmanager.register(logging_plugin, 'logging-plugin')343536def test_logger(app):37 assert app.logger.name == 'flask.app'
61 unmodified lines