Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-Werkzeug for openSUSE:Factory
checked in at 2022-05-08 21:52:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Werkzeug (Old)
and /work/SRC/openSUSE:Factory/.python-Werkzeug.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Werkzeug"
Sun May 8 21:52:23 2022 rev:36 rq:975271 version:2.1.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Werkzeug/python-Werkzeug.changes
2022-04-23 19:45:39.314961138 +0200
+++
/work/SRC/openSUSE:Factory/.python-Werkzeug.new.1538/python-Werkzeug.changes
2022-05-08 21:52:33.439478592 +0200
@@ -1,0 +2,8 @@
+Thu Apr 28 16:25:37 UTC 2022 - Matej Cepl <[email protected]>
+
+- Replace no-network-testing.patch with the upstream solution
+ 2402-dev_server.patch from gh#pallets/werkzeug#2402.
+- Add moved_root.patch to make test test_exclude_patterns with
+ different PYTHONPATH.
+
+-------------------------------------------------------------------
Old:
----
no-network-testing.patch
New:
----
2402-dev_server.patch
moved_root.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Werkzeug.spec ++++++
--- /var/tmp/diff_new_pack.0SRE0I/_old 2022-05-08 21:52:33.867479130 +0200
+++ /var/tmp/diff_new_pack.0SRE0I/_new 2022-05-08 21:52:33.871479135 +0200
@@ -27,9 +27,13 @@
Group: Development/Languages/Python
URL: https://werkzeug.palletsprojects.com
Source:
https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM no-network-testing.patch gh#pallets/werkzeug#2393
[email protected]
-# mark tests which require network access
-Patch0: no-network-testing.patch
+# PATCH-FIX-UPSTREAM 2402-dev_server.patch gh#pallets/werkzeug#2393
[email protected]
+# upstream solution to mark tests which require development server
+# from https://github.com/pallets/werkzeug/pull/2402
+Patch0: 2402-dev_server.patch
+# PATCH-FIX-UPSTREAM moved_root.patch bsc#[0-9]+ [email protected]
+# this patch makes things totally awesome
+Patch1: moved_root.patch
BuildRequires: %{python_module cryptography}
BuildRequires: %{python_module ephemeral-port-reserve}
BuildRequires: %{python_module hypothesis}
@@ -83,7 +87,7 @@
export LANG=en_US.UTF-8
export PYTHONDONTWRITEBYTECODE=1
# workaround pytest 6.2 (like
https://github.com/pallets/werkzeug/commit/16718f461d016b88b6457d3ef63816b7df1f0d1f,
but shorter)
-%pytest -k 'not (network or test_reloader_sys_path or test_chunked_encoding or
test_basic or test_server or test_ssl or test_http_proxy or test_500_error or
test_untrusted_host or test_double_slash_path or test_wrong_protocol or
test_content_type_and_length or test_multiple_headers_concatenated or
test_multiline_header_folding)'
+%pytest -k 'not (dev_server or test_reloader_sys_path or test_chunked_encoding
or test_basic or test_server or test_ssl or test_http_proxy or test_500_error
or test_untrusted_host or test_double_slash_path or test_wrong_protocol or
test_content_type_and_length or test_multiple_headers_concatenated or
test_multiline_header_folding)'
%files %{python_files}
%license LICENSE.rst
++++++ 2402-dev_server.patch ++++++
>From 9d83ed43027b6538efde5b708395fed36700d970 Mon Sep 17 00:00:00 2001
From: David Lord <[email protected]>
Date: Mon, 25 Apr 2022 11:08:09 -0700
Subject: [PATCH] mark test that use the dev_server
---
setup.cfg | 2 ++
tests/middleware/test_http_proxy.py | 1 +
tests/test_debug.py | 1 +
tests/test_serving.py | 15 +++++++++++++++
4 files changed, 19 insertions(+)
--- a/setup.cfg
+++ b/setup.cfg
@@ -44,6 +44,8 @@ where = src
testpaths = tests
filterwarnings =
error
+markers =
+ dev_server: tests that start the dev server
[coverage:run]
branch = True
--- a/tests/middleware/test_http_proxy.py
+++ b/tests/middleware/test_http_proxy.py
@@ -6,6 +6,7 @@ from werkzeug.wrappers import Response
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_http_proxy(standard_app):
app = ProxyMiddleware(
Response("ROOT"),
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -247,6 +247,7 @@ def test_get_machine_id():
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
@pytest.mark.parametrize("crash", (True, False))
[email protected]_server
def test_basic(dev_server, crash):
c = dev_server(use_debugger=True)
r = c.request("/crash" if crash else "")
--- a/tests/test_serving.py
+++ b/tests/test_serving.py
@@ -35,6 +35,7 @@ from werkzeug.test import stream_encode_
),
],
)
[email protected]_server
def test_server(tmp_path, dev_server, kwargs: dict):
if kwargs.get("hostname") == "unix":
kwargs["hostname"] = f"unix://{tmp_path / 'test.sock'}"
@@ -46,6 +47,7 @@ def test_server(tmp_path, dev_server, kw
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_untrusted_host(standard_app):
r = standard_app.request(
"http://missing.test:1337/index.html#ignore",
@@ -59,6 +61,7 @@ def test_untrusted_host(standard_app):
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_double_slash_path(standard_app):
r = standard_app.request("//double-slash")
assert "double-slash" not in r.json["HTTP_HOST"]
@@ -66,6 +69,7 @@ def test_double_slash_path(standard_app)
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_500_error(standard_app):
r = standard_app.request("/crash")
assert r.status == 500
@@ -73,6 +77,7 @@ def test_500_error(standard_app):
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_ssl_dev_cert(tmp_path, dev_server):
client = dev_server(ssl_context=make_ssl_devcert(tmp_path))
r = client.request()
@@ -80,6 +85,7 @@ def test_ssl_dev_cert(tmp_path, dev_serv
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_ssl_object(dev_server):
client = dev_server(ssl_context="custom")
r = client.request()
@@ -91,6 +97,7 @@ def test_ssl_object(dev_server):
@pytest.mark.skipif(
os.name == "nt" and "CI" in os.environ, reason="unreliable on Windows
during CI"
)
[email protected]_server
def test_reloader_sys_path(tmp_path, dev_server, reloader_type):
"""This tests the general behavior of the reloader. It also tests
that fixing an import error triggers a reload, not just Python
@@ -129,6 +136,7 @@ def test_exclude_patterns(find):
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_wrong_protocol(standard_app):
"""An HTTPS request to an HTTP server doesn't show a traceback.
https://github.com/pallets/werkzeug/pull/838
@@ -142,6 +150,7 @@ def test_wrong_protocol(standard_app):
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_content_type_and_length(standard_app):
r = standard_app.request()
assert "CONTENT_TYPE" not in r.json
@@ -159,6 +168,7 @@ def test_port_is_int():
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
@pytest.mark.parametrize("send_length", [False, True])
[email protected]_server
def test_chunked_request(monkeypatch, dev_server, send_length):
stream, length, boundary = stream_encode_multipart(
{
@@ -200,6 +210,7 @@ def test_chunked_request(monkeypatch, de
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_multiple_headers_concatenated(standard_app):
"""A header key can be sent multiple times. The server will join all
the values with commas.
@@ -224,6 +235,7 @@ def test_multiple_headers_concatenated(s
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_multiline_header_folding(standard_app):
"""A header value can be split over multiple lines with a leading
tab. The server will remove the newlines and preserve the tabs.
@@ -242,6 +254,7 @@ def test_multiline_header_folding(standa
@pytest.mark.parametrize("endpoint", ["", "crash"])
[email protected]_server
def test_streaming_close_response(dev_server, endpoint):
"""When using HTTP/1.0, chunked encoding is not supported. Fall
back to Connection: close, but this allows no reliable way to
@@ -252,6 +265,7 @@ def test_streaming_close_response(dev_se
assert r.data == "".join(str(x) + "\n" for x in range(5)).encode()
[email protected]_server
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
@@ -265,6 +279,7 @@ def test_streaming_chunked_response(dev_
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
[email protected]_server
def test_streaming_chunked_truncation(dev_server):
"""When using HTTP/1.1, chunked encoding allows the client to detect
content truncated by a prematurely closed connection.
++++++ moved_root.patch ++++++
---
tests/test_serving.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/tests/test_serving.py
+++ b/tests/test_serving.py
@@ -10,6 +10,7 @@ from pathlib import Path
import pytest
+import werkzeug
from werkzeug import run_simple
from werkzeug._reloader import _find_stat_paths
from werkzeug._reloader import _find_watchdog_paths
@@ -127,12 +128,15 @@ def test_windows_get_args_for_reloading(
@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.
+ # Don???t use sys.prefix, we may have redefined PYTHONPATH and
+ # libraries elsewhere.
+ cur_prefix = str(Path(werkzeug.__file__).parents[1])
+ # Imported paths under cur_prefix will be included by default.
paths = find(set(), set())
- assert any(p.startswith(sys.prefix) for p in paths)
+ assert any(p.startswith(cur_prefix) for p in paths)
# Those paths should be excluded due to the pattern.
- paths = find(set(), {f"{sys.prefix}*"})
- assert not any(p.startswith(sys.prefix) for p in paths)
+ paths = find(set(), {f"{str(cur_prefix)}*"})
+ assert not any(p.startswith(cur_prefix) for p in paths)
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")