Skip to content

Commit

Permalink
Fix test failure with Pytest 8.0
Browse files Browse the repository at this point in the history
Not sure why this didn't fail before the pytest update, but oh well.

Fixes #2845.
  • Loading branch information
triallax committed Jan 29, 2024
1 parent d3dd65a commit 7978a8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Version 3.0.1
-------------

Unreleased

- Fix test failure with Pytest 8.0. :issue:`2845` :pr:`2846`

Version 3.0.1
-------------

Released 2023-10-24

- Fix slow multipart parsing for large parts potentially enabling DoS
Expand Down
6 changes: 5 additions & 1 deletion tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from werkzeug.datastructures import Headers
from werkzeug.datastructures import WWWAuthenticate
from werkzeug.exceptions import HTTPException
from werkzeug.routing import RequestRedirect
from werkzeug.wrappers import Response


Expand Down Expand Up @@ -163,7 +164,10 @@ def test_description_none():
),
)
def test_response_body(cls):
exc = cls()
if cls == RequestRedirect:
exc = cls("https://example.com")
else:
exc = cls()
response_body = exc.get_body()
assert response_body.startswith("<!doctype html>\n<html lang=en>\n")
assert f"{exc.code} {escape(exc.name)}" in response_body
Expand Down

0 comments on commit 7978a8b

Please sign in to comment.