fix: Replace print() with logger in flask
This commit is contained in:
parent
954f5684e4
commit
ace63948bf
1 changed files with 4 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
@ -119,13 +121,13 @@ def test_blueprint_with_subdomain():
|
||||||
app.config["APPLICATION_ROOT"] = "/foo"
|
app.config["APPLICATION_ROOT"] = "/foo"
|
||||||
client = app.test_client()
|
client = app.test_client()
|
||||||
|
|
||||||
bp = flask.Blueprint("company", __name__, subdomain="xxx")
|
bp = flask.Bluelogger.info("company", __name__, subdomain="xxx")
|
||||||
|
|
||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
def index():
|
def index():
|
||||||
return flask.request.url
|
return flask.request.url
|
||||||
|
|
||||||
app.register_blueprint(bp)
|
app.register_bluelogger.info(bp)
|
||||||
|
|
||||||
ctx = app.test_request_context("/", subdomain="xxx")
|
ctx = app.test_request_context("/", subdomain="xxx")
|
||||||
assert ctx.request.url == "http://xxx.example.com:1234/foo/"
|
assert ctx.request.url == "http://xxx.example.com:1234/foo/"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue