Skip to content

Commit

Permalink
chore: Support for Werkzeug>=2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Mar 29, 2022
1 parent 9e1fb3d commit baa97df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changelog
`Unreleased`_ - TBD
-------------------

**Added**

- Support for Werkzeug>=2.1.0. `#1410`_

`2.8.5`_ - 2020-12-15
---------------------

Expand Down Expand Up @@ -1580,6 +1584,7 @@ Deprecated
.. _0.3.0: https://github.com/schemathesis/schemathesis/compare/v0.2.0...v0.3.0
.. _0.2.0: https://github.com/schemathesis/schemathesis/compare/v0.1.0...v0.2.0

.. _#1410: https://github.com/schemathesis/schemathesis/issues/1410
.. _#917: https://github.com/schemathesis/schemathesis/issues/917
.. _#897: https://github.com/schemathesis/schemathesis/issues/897
.. _#895: https://github.com/schemathesis/schemathesis/issues/895
Expand Down
10 changes: 10 additions & 0 deletions src/schemathesis/_compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# pylint: disable=unused-import
import werkzeug
from packaging import version

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata # type: ignore

if version.parse(werkzeug.__version__) < version.parse("2.1.0"):
from werkzeug.wrappers.json import JSONMixin
else:

class JSONMixin: # type: ignore
pass
2 changes: 1 addition & 1 deletion src/schemathesis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from requests.exceptions import InvalidHeader # type: ignore
from requests.utils import check_header_validity # type: ignore
from werkzeug.wrappers import Response as BaseResponse
from werkzeug.wrappers.json import JSONMixin

from ._compat import JSONMixin
from .types import Filter, NotSet, RawAuth

try:
Expand Down

0 comments on commit baa97df

Please sign in to comment.