use app.name as app.logger name

This commit is contained in:
David Lord 2019-07-01 14:56:18 -07:00
parent 465da9f610
commit df470aecb9
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
8 changed files with 40 additions and 25 deletions

View file

@ -23,7 +23,7 @@ def reset_logging(pytestconfig):
logging.root.handlers = []
root_level = logging.root.level
logger = logging.getLogger("flask.app")
logger = logging.getLogger("flask_test")
logger.handlers = []
logger.setLevel(logging.NOTSET)
@ -42,7 +42,7 @@ def reset_logging(pytestconfig):
def test_logger(app):
assert app.logger.name == "flask.app"
assert app.logger.name == "flask_test"
assert app.logger.level == logging.NOTSET
assert app.logger.handlers == [default_handler]

View file

@ -430,7 +430,9 @@ def test_template_loader_debugging(test_apps, monkeypatch):
with app.test_client() as c:
monkeypatch.setitem(app.config, "EXPLAIN_TEMPLATE_LOADING", True)
monkeypatch.setattr(logging.getLogger("flask"), "handlers", [_TestHandler()])
monkeypatch.setattr(
logging.getLogger("blueprintapp"), "handlers", [_TestHandler()]
)
with pytest.raises(TemplateNotFound) as excinfo:
c.get("/missing")