Remove deprecated items (#2555)
This commit is contained in:
@@ -525,7 +525,7 @@ def test_multiple_uvloop_configs_display_warning(caplog):
|
||||
|
||||
counter = Counter([(r[1], r[2]) for r in caplog.record_tuples])
|
||||
|
||||
assert counter[(logging.WARNING, message)] == 2
|
||||
assert counter[(logging.WARNING, message)] == 3
|
||||
|
||||
|
||||
def test_cannot_run_fast_and_workers(app: Sanic):
|
||||
|
||||
@@ -125,14 +125,9 @@ def test_env_w_custom_converter():
|
||||
|
||||
|
||||
def test_env_lowercase():
|
||||
with pytest.warns(None) as record:
|
||||
environ["SANIC_test_answer"] = "42"
|
||||
app = Sanic(name="Test")
|
||||
assert app.config.test_answer == 42
|
||||
assert str(record[0].message) == (
|
||||
"[DEPRECATION v22.9] Lowercase environment variables will not be "
|
||||
"loaded into Sanic config beginning in v22.9."
|
||||
)
|
||||
environ["SANIC_test_answer"] = "42"
|
||||
app = Sanic(name="Test")
|
||||
assert "test_answer" not in app.config
|
||||
del environ["SANIC_test_answer"]
|
||||
|
||||
|
||||
|
||||
@@ -97,15 +97,15 @@ def test_auto_fallback_with_content_type(app):
|
||||
def test_route_error_format_set_on_auto(app):
|
||||
@app.get("/text")
|
||||
def text_response(request):
|
||||
return text(request.route.ctx.error_format)
|
||||
return text(request.route.extra.error_format)
|
||||
|
||||
@app.get("/json")
|
||||
def json_response(request):
|
||||
return json({"format": request.route.ctx.error_format})
|
||||
return json({"format": request.route.extra.error_format})
|
||||
|
||||
@app.get("/html")
|
||||
def html_response(request):
|
||||
return html(request.route.ctx.error_format)
|
||||
return html(request.route.extra.error_format)
|
||||
|
||||
_, response = app.test_client.get("/text")
|
||||
assert response.text == "text"
|
||||
|
||||
Reference in New Issue
Block a user