Merge branch '2.0.x'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parents 7860c1d, 3720669 · Browse files · 9 files·+94 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+94 added−13 removed
- other:+94 added−13 removed
Provenance
- Commit
ea66c68- Tree
04befa2- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
7860c1d- Parent 2
3720669
9 files changed+94 added−13 removed
modified:.github/workflows/tests.yaml+2 added
30 unmodified lines3132333435363738394017 unmodified lines30 unmodified lines - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - {name: 'PyPy', python: 'pypy-3.7', os: ubuntu-latest, tox: pypy37} - {name: 'Pallets Minimum Versions', python: '3.10', os: ubuntu-latest, tox: py-min} - {name: 'Pallets Development Versions', python: '3.7', os: ubuntu-latest, tox: py-dev} - {name: Typing, python: '3.10', os: ubuntu-latest, tox: typing} steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v217 unmodified linesmodified:docs/quickstart.rst+1 added-1 removed
466 unmodified lines467 Markup('<strong>Hello <blink>hacker</blink>!</strong>')468 >>> Markup.escape('<blink>hacker</blink>')469 Markup('<blink>hacker</blink>')470 >>> Markup('<em>Marked up</em> » HTML').striptags()471- 'Marked up \xbb HTML'471+ 'Marked up » HTML'472 473 .. versionchanged:: 0.5474 475 Autoescaping is no longer enabled for all templates. The following463 unmodified linesadded:requirements/tests-pallets-dev.in+5 added
1+https://github.com/pallets/werkzeug/archive/refs/heads/main.tar.gz2+https://github.com/pallets/jinja/archive/refs/heads/main.tar.gz3+https://github.com/pallets/markupsafe/archive/refs/heads/main.tar.gz4+https://github.com/pallets/itsdangerous/archive/refs/heads/main.tar.gz5+https://github.com/pallets/click/archive/refs/heads/main.tar.gzadded:requirements/tests-pallets-dev.txt+18 added
1+#2+# This file is autogenerated by pip-compile with python 3.103+# To update, run:4+#5+# pip-compile requirements/tests-pallets-dev.in6+#7+click @ https://github.com/pallets/click/archive/refs/heads/main.tar.gz8+ # via -r requirements/tests-pallets-dev.in9+itsdangerous @ https://github.com/pallets/itsdangerous/archive/refs/heads/main.tar.gz10+ # via -r requirements/tests-pallets-dev.in11+jinja2 @ https://github.com/pallets/jinja/archive/refs/heads/main.tar.gz12+ # via -r requirements/tests-pallets-dev.in13+markupsafe @ https://github.com/pallets/markupsafe/archive/refs/heads/main.tar.gz14+ # via15+ # -r requirements/tests-pallets-dev.in16+ # jinja217+werkzeug @ https://github.com/pallets/werkzeug/archive/refs/heads/main.tar.gz18+ # via -r requirements/tests-pallets-dev.inadded:requirements/tests-pallets-min.in+5 added
1+Werkzeug==2.0.02+Jinja2==3.0.03+MarkupSafe==2.0.04+itsdangerous==2.0.05+click==8.0.0added:requirements/tests-pallets-min.txt+18 added
1+#2+# This file is autogenerated by pip-compile with python 3.103+# To update, run:4+#5+# pip-compile requirements/tests-pallets-min.in6+#7+click==8.0.08+ # via -r requirements/tests-pallets-min.in9+itsdangerous==2.0.010+ # via -r requirements/tests-pallets-min.in11+jinja2==3.0.012+ # via -r requirements/tests-pallets-min.in13+markupsafe==2.0.014+ # via15+ # -r requirements/tests-pallets-min.in16+ # jinja217+werkzeug==2.0.018+ # via -r requirements/tests-pallets-min.inmodified:src/flask/testing.py+30 added-12 removed
7 unmodified lines8 from werkzeug.test import Client9 from werkzeug.urls import url_parse10 from werkzeug.wrappers import Request as BaseRequest11 12-from . import _request_ctx_stack12 from .cli import ScriptInfo13+from .globals import _request_ctx_stack14 from .json import dumps as json_dumps15 from .sessions import SessionMixin16 17 if t.TYPE_CHECKING:18+ from werkzeug.test import TestResponse19+20 from .app import Flask19- from .wrappers import Response21 22 23 class EnvironBuilder(werkzeug.test.EnvironBuilder):24 """An :class:`~werkzeug.test.EnvironBuilder`, that takes defaults from the146 unmodified lines171 session_interface.save_session(app, sess, resp)172 headers = resp.get_wsgi_headers(c.request.environ)173 self.cookie_jar.extract_wsgi(c.request.environ, headers)174 174- def open( # type: ignore175+ def open(176 self,177 *args: t.Any,177- as_tuple: bool = False,178 buffered: bool = False,179 follow_redirects: bool = False,180 **kwargs: t.Any,181- ) -> "Response":181+ ) -> "TestResponse":182+ as_tuple = kwargs.pop("as_tuple", None)183+184 # Same logic as super.open, but apply environ_base and preserve_context.185 request = None186 187 def copy_environ(other):26 unmodified lines214 request = builder.get_request()215 finally:216 builder.close()217 216- return super().open( # type: ignore217- request,218- as_tuple=as_tuple,219- buffered=buffered,220- follow_redirects=follow_redirects,221- )218+ if as_tuple is not None:219+ import warnings220 221+ warnings.warn(222+ "'as_tuple' is deprecated and will be removed in"223+ " Werkzeug 2.1 and Flask 2.1. Use"224+ " 'response.request.environ' instead.",225+ DeprecationWarning,226+ stacklevel=3,227+ )228+ return super().open(229+ request,230+ as_tuple=as_tuple,231+ buffered=buffered,232+ follow_redirects=follow_redirects,233+ )234+ else:235+ return super().open(236+ request,237+ buffered=buffered,238+ follow_redirects=follow_redirects,239+ )240+241 def __enter__(self) -> "FlaskClient":242 if self.preserve_context:243 raise RuntimeError("Cannot nest client invocations")244 self.preserve_context = True44 unmodified lines289 290 :return: a :class:`~click.testing.Result` object.291 """292 if cli is None:275- cli = self.app.cli293+ cli = self.app.cli # type: ignore294 295 if "obj" not in kwargs:296 kwargs["obj"] = ScriptInfo(create_app=lambda: self.app)297 1 unmodified linemodified:CHANGES.rst+11 added
28 unmodified lines29 - ``add_etags`` is renamed to ``etag``.30 - ``filename`` is renamed to ``path``.31 32 33+Version 2.0.334+-------------35+36+Unreleased37+38+- The test client's ``as_tuple`` parameter is deprecated and will be39+ removed in Werkzeug 2.1. It is now also deprecated in Flask, to be40+ removed in Flask 2.1, while remaining compatible with both in41+ 2.0.x. Use ``response.request.environ`` instead. :pr:`4341`42+43+44 Version 2.0.245 -------------46 47 Released 2021-10-041178 unmodified linesmodified:tox.ini+4 added
1 [tox]2 envlist =3 py3{11,10,9,8,7},pypy3{8,7}4+ py310-min5+ py37-dev6 style7 typing8 docs9 skip_missing_interpreters = true10 11 [testenv]12 deps =13 -r requirements/tests.txt14+ min: -r requirements/tests-pallets-min.txt15+ dev: -r requirements/tests-pallets-dev.txt16 17 examples/tutorial[test]18 examples/javascript[test]19 commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs:tests examples}13 unmodified lines