Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-oleshkevich committed Jul 10, 2023
1 parent ab6a689 commit b3418eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion starlette/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def TemplateResponse(
if "request" not in kwargs:
warnings.warn(
"The `TemplateResponse` now requires the `request` argument.\n"
'Replace `TemplateResponse(name, {"context": context})` by `TemplateResponse(request, name)`.", # noqa: E501
'Replace `TemplateResponse(name, {"context": context})` by `TemplateResponse(request, name)`.', # noqa: E501
DeprecationWarning,
)
if "request" not in kwargs.get("context", {}):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_templates_with_kwargs_only_requires_request_in_context(tmpdir):
templates = Jinja2Templates(directory=str(tmpdir))
with pytest.warns(
DeprecationWarning,
match="TemplateResponse requires `request` keyword argument.",
match="requires the `request` argument",
):
with pytest.raises(ValueError):
templates.TemplateResponse(name="index.html", context={"a": "b"})
Expand All @@ -220,7 +220,7 @@ def page(request):

with pytest.warns(
DeprecationWarning,
match="TemplateResponse requires `request` keyword argument.",
match="requires the `request` argument",
):
client.get("/")

Expand Down

0 comments on commit b3418eb

Please sign in to comment.