forked from orbit-oss/flask
use app.name as app.logger name
This commit is contained in:
parent
465da9f610
commit
df470aecb9
8 changed files with 40 additions and 25 deletions
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue