Skip to content
Myr

Merge pull request #2554 from camilojimenez/2550-some-tests-fail

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

fix non-passing tests for logging on pytest >= 3.3.0

authored by David Lord · committed by GitHub · parents db56e38, 604cc75 · Browse files · 1 file+8 added−1 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+8 added−1 removed

  • tests:+8 added−1 removed

1 file+8 added−1 removed

modified:tests/test_logging.py+8 added-1 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)2021 logging_plugin = pytestconfig.pluginmanager.unregister(22 name='logging-plugin')2324 yield2526 logging.root.handlers[:] = root_handlers27 logging.root.setLevel(root_level)2829 logger.handlers = []30 logger.setLevel(logging.NOTSET)3132 if logging_plugin:33 pytestconfig.pluginmanager.register(logging_plugin, 'logging-plugin')343536def test_logger(app):37 assert app.logger.name == 'flask.app'38 assert app.logger.level == logging.NOTSET39 assert app.logger.handlers == [default_handler]
59 unmodified lines