diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-25 22:07:13 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-25 22:07:13 -0500 |
commit | 1a5302435ff0d2822b823f5a6fe01faa7a85c629 (patch) | |
tree | ac7810c88b560532f22d2bab2e59609cd7305c21 /gnu/packages/patches/python-werkzeug-tests.patch | |
parent | 3ff2ac4980dacf10087e4b42bd9fbc490591900c (diff) | |
parent | 070b8a893febd6e7d8b2b7c8c4dcebacf7845aa9 (diff) |
Merge branch 'master' into staging.
With "conflicts" solved (all in favor of master except git) in:
gnu/local.mk
gnu/packages/databases.scm
gnu/packages/glib.scm
gnu/packages/gnome.scm
gnu/packages/gnupg.scm
gnu/packages/gnuzilla.scm
gnu/packages/graphics.scm
gnu/packages/gstreamer.scm
gnu/packages/gtk.scm
gnu/packages/linux.scm
gnu/packages/machine-learning.scm
gnu/packages/networking.scm
gnu/packages/polkit.scm
gnu/packages/pulseaudio.scm
gnu/packages/rpc.scm
gnu/packages/rust.scm
gnu/packages/version-control.scm
gnu/packages/w3m.scm
Diffstat (limited to 'gnu/packages/patches/python-werkzeug-tests.patch')
-rw-r--r-- | gnu/packages/patches/python-werkzeug-tests.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-werkzeug-tests.patch b/gnu/packages/patches/python-werkzeug-tests.patch new file mode 100644 index 0000000000..4eca53f30c --- /dev/null +++ b/gnu/packages/patches/python-werkzeug-tests.patch @@ -0,0 +1,58 @@ +Do not leave open files behind as this triggers 'ResourceWarning' and leads +these tests to fail. + +--- Werkzeug-1.0.1/tests/test_datastructures.py 2020-03-31 19:48:06.000000000 +0200 ++++ Werkzeug-1.0.1/tests/test_datastructures.py 2021-11-21 18:19:11.304369878 +0100 +@@ -1238,9 +1238,10 @@ + def test_save_to_pathlib_dst(self, tmp_path): + src = tmp_path / "src.txt" + src.write_text(u"test") +- storage = self.storage_class(src.open("rb")) +- dst = tmp_path / "dst.txt" +- storage.save(dst) ++ with src.open("rb") as input: ++ storage = self.storage_class(input) ++ dst = tmp_path / "dst.txt" ++ storage.save(dst) + assert dst.read_text() == "test" + + def test_save_to_bytes_io(self): +@@ -1251,11 +1252,12 @@ + + def test_save_to_file(self, tmp_path): + path = tmp_path / "file.data" +- storage = self.storage_class(io.BytesIO(b"one\ntwo")) +- with path.open("wb") as dst: +- storage.save(dst) +- with path.open("rb") as src: +- assert src.read() == b"one\ntwo" ++ with io.BytesIO(b"one\ntwo") as input: ++ storage = self.storage_class(input) ++ with path.open("wb") as dst: ++ storage.save(dst) ++ with path.open("rb") as src: ++ assert src.read() == b"one\ntwo" + + + @pytest.mark.parametrize("ranges", ([(0, 1), (-5, None)], [(5, None)])) +--- Werkzeug-1.0.1/tests/test_formparser.py 2020-03-31 19:48:06.000000000 +0200 ++++ Werkzeug-1.0.1/tests/test_formparser.py 2021-11-21 22:11:43.654622751 +0100 +@@ -27,7 +27,7 @@ + from werkzeug.test import create_environ + from werkzeug.wrappers import Request + from werkzeug.wrappers import Response +- ++import warnings + + @Request.application + def form_data_consumer(request): +@@ -242,6 +244,9 @@ + + class TestMultiPart(object): + def test_basic(self): ++ # Ignore leaked file descriptor of unknown origin. ++ warnings.filterwarnings(action="ignore", message="unclosed", category=ResourceWarning) ++ + resources = join(dirname(__file__), "multipart") + client = Client(form_data_consumer, Response) + |