forked from orbit-oss/flask
fix non-passing tests for logging on pytest > 3.3.0
This commit is contained in:
parent
4556ab2e06
commit
e30c39fe78
1 changed files with 6 additions and 0 deletions
|
|
@ -17,6 +17,10 @@ def reset_logging(monkeypatch):
|
||||||
logger.handlers = []
|
logger.handlers = []
|
||||||
logger.setLevel(logging.NOTSET)
|
logger.setLevel(logging.NOTSET)
|
||||||
|
|
||||||
|
logging_plugin = pytest.config.pluginmanager.getplugin('logging-plugin')
|
||||||
|
pytest.config.pluginmanager.unregister(name='logging-plugin')
|
||||||
|
logging.root.handlers = []
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
logging.root.handlers[:] = root_handlers
|
logging.root.handlers[:] = root_handlers
|
||||||
|
|
@ -25,6 +29,8 @@ def reset_logging(monkeypatch):
|
||||||
logger.handlers = []
|
logger.handlers = []
|
||||||
logger.setLevel(logging.NOTSET)
|
logger.setLevel(logging.NOTSET)
|
||||||
|
|
||||||
|
pytest.config.pluginmanager.register(logging_plugin, 'logging-plugin')
|
||||||
|
|
||||||
|
|
||||||
def test_logger(app):
|
def test_logger(app):
|
||||||
assert app.logger.name == 'flask.app'
|
assert app.logger.name == 'flask.app'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue