aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-12 20:45:18 +0200
committerMarius Bakke <marius@gnu.org>2022-08-13 12:28:46 +0200
commit431df1214e5c5819ca22157a8a6d94d1e066a56b (patch)
tree04b9c3d00e054dcfecd7ea94b5052e4475ef0388 /gnu/packages/patches
parentf561830a5bc6d7df07fbf3cd8af37e4f83f33620 (diff)
downloadguix-431df1214e5c5819ca22157a8a6d94d1e066a56b.tar.gz
guix-431df1214e5c5819ca22157a8a6d94d1e066a56b.zip
gnu: python-dateutil: Adjust tests for Pytest 7.
* gnu/packages/patches/python-dateutil-pytest-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/time.scm (python-dateutil)[source](patches): New field.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/python-dateutil-pytest-compat.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-dateutil-pytest-compat.patch b/gnu/packages/patches/python-dateutil-pytest-compat.patch
new file mode 100644
index 0000000000..5cff57e94c
--- /dev/null
+++ b/gnu/packages/patches/python-dateutil-pytest-compat.patch
@@ -0,0 +1,43 @@
+Add compatibility with newer versions of pytest.
+
+Taken from upstream:
+
+ https://github.com/dateutil/dateutil/commit/2bdd63158b7f981fc6d70a869680451bdfd8d848
+
+diff --git a/dateutil/test/test_internals.py b/dateutil/test/test_internals.py
+index 53081314..b32e6723 100644
+--- a/dateutil/test/test_internals.py
++++ b/dateutil/test/test_internals.py
+@@ -9,6 +9,7 @@
+
+ import sys
+ import pytest
++import warnings
+
+ from dateutil.parser._parser import _ymd
+ from dateutil import tz
+@@ -65,18 +66,17 @@ def test_parser_parser_private_not_warns():
+ from dateutil.parser._parser import _timelex, _tzparser
+ from dateutil.parser._parser import _parsetz
+
+- with pytest.warns(None) as recorder:
++ with warnings.catch_warnings():
++ warnings.simplefilter("error")
+ _tzparser()
+- assert len(recorder) == 0
+
+- with pytest.warns(None) as recorder:
++ with warnings.catch_warnings():
++ warnings.simplefilter("error")
+ _timelex('2014-03-03')
+
+- assert len(recorder) == 0
+-
+- with pytest.warns(None) as recorder:
++ with warnings.catch_warnings():
++ warnings.simplefilter("error")
+ _parsetz('+05:00')
+- assert len(recorder) == 0
+
+
+ @pytest.mark.tzstr