forked from pool/python-Werkzeug
- Update to 2.1.1:
- ResponseCacheControl.s_maxage converts its value to an int,
like max_age.
- Drop support for Python 3.6.
- Using gevent or eventlet requires greenlet>=1.0 or
PyPy>=7.3.7. werkzeug.locals and contextvars will not work
correctly with older versions.
- Remove previously deprecated code.
- Remove the non-standard shutdown function from the WSGI
environ when running the development server. See the docs
for alternatives.
- Request and response mixins have all been merged into the
Request and Response classes.
- The user agent parser and the useragents module is
removed. The user_agent module provides an interface that
can be subclassed to add a parser, such as ua-parser. By
default it only stores the whole string.
- The test client returns TestResponse instances and can no
longer be treated as a tuple. All data is available as
properties on the response.
- Remove locals.get_ident and related thread-local code from
locals, it no longer makes sense when moving to
a contextvars-based implementation.
- Remove the python -m werkzeug.serving CLI.
- The has_key method on some mapping datastructures; use key
in data instead.
- Request.disable_data_descriptor is removed, pass
shallow=True instead.
- Remove the no_etag parameter from Response.freeze().
- Remove the HTTPException.wrap class method.
OBS-URL: https://build.opensuse.org/request/show/970987
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Werkzeug?expand=0&rev=62
54 lines
1.9 KiB
Diff
54 lines
1.9 KiB
Diff
---
|
|
pytest.ini | 3 +++
|
|
tests/test_serving.py | 5 +++++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
--- /dev/null
|
|
+++ b/pytest.ini
|
|
@@ -0,0 +1,3 @@
|
|
+[pytest]
|
|
+markers =
|
|
+ network: tests requiring network connection
|
|
--- a/tests/test_serving.py
|
|
+++ b/tests/test_serving.py
|
|
@@ -118,6 +118,7 @@ def test_windows_get_args_for_reloading(
|
|
assert rv == argv
|
|
|
|
|
|
+@pytest.mark.network
|
|
@pytest.mark.parametrize("find", [_find_stat_paths, _find_watchdog_paths])
|
|
def test_exclude_patterns(find):
|
|
# Imported paths under sys.prefix will be included by default.
|
|
@@ -157,6 +158,7 @@ def test_port_is_int():
|
|
run_simple("127.0.0.1", "5000", None)
|
|
|
|
|
|
+@pytest.mark.network
|
|
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
|
|
@pytest.mark.parametrize("send_length", [False, True])
|
|
def test_chunked_request(monkeypatch, dev_server, send_length):
|
|
@@ -241,6 +243,7 @@ def test_multiline_header_folding(standa
|
|
assert data["HTTP_XYZ"] == "first\tsecond\tthird"
|
|
|
|
|
|
+@pytest.mark.network
|
|
@pytest.mark.parametrize("endpoint", ["", "crash"])
|
|
def test_streaming_close_response(dev_server, endpoint):
|
|
"""When using HTTP/1.0, chunked encoding is not supported. Fall
|
|
@@ -252,6 +255,7 @@ def test_streaming_close_response(dev_se
|
|
assert r.data == "".join(str(x) + "\n" for x in range(5)).encode()
|
|
|
|
|
|
+@pytest.mark.network
|
|
def test_streaming_chunked_response(dev_server):
|
|
"""When using HTTP/1.1, use Transfer-Encoding: chunked for streamed
|
|
responses, since it can distinguish the end of the response without
|
|
@@ -264,6 +268,7 @@ def test_streaming_chunked_response(dev_
|
|
assert r.data == "".join(str(x) + "\n" for x in range(5)).encode()
|
|
|
|
|
|
+@pytest.mark.network
|
|
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
|
|
def test_streaming_chunked_truncation(dev_server):
|
|
"""When using HTTP/1.1, chunked encoding allows the client to detect
|