[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/12: gnu: python-dateutil: Adjust tests for Pytest 7.
From: |
guix-commits |
Subject: |
03/12: gnu: python-dateutil: Adjust tests for Pytest 7. |
Date: |
Sat, 13 Aug 2022 13:25:19 -0400 (EDT) |
mbakke pushed a commit to branch staging
in repository guix.
commit 431df1214e5c5819ca22157a8a6d94d1e066a56b
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Fri Aug 12 20:45:18 2022 +0200
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.
---
gnu/local.mk | 1 +
.../patches/python-dateutil-pytest-compat.patch | 43 ++++++++++++++++++++++
gnu/packages/time.scm | 1 +
3 files changed, 45 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0ee0a4d8b6..f0c1f60c8a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1692,6 +1692,7 @@ dist_patch_DATA =
\
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
%D%/packages/patches/python-cross-compile.patch \
%D%/packages/patches/python-configobj-setuptools.patch \
+ %D%/packages/patches/python-dateutil-pytest-compat.patch \
%D%/packages/patches/python-debugpy-unbundle-pydevd.patch \
%D%/packages/patches/python-docopt-pytest6-compat.patch \
%D%/packages/patches/python-execnet-read-only-fix.patch \
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
diff --git a/gnu/packages/time.scm b/gnu/packages/time.scm
index fea9ff25f7..9128056f78 100644
--- a/gnu/packages/time.scm
+++ b/gnu/packages/time.scm
@@ -196,6 +196,7 @@ Pendulum instances.")
(origin
(method url-fetch)
(uri (pypi-uri "python-dateutil" version))
+ (patches (search-patches "python-dateutil-pytest-compat.patch"))
(sha256
(base32
"11iy7m4bp2lgfkcl0r6xzf34bvk7ppjmsyn2ygfikbi72v6cl8q1"))))
- branch staging updated (b50eaa6764 -> 213c60f332), guix-commits, 2022/08/13
- 01/12: gnu: qtscxml: Fix build failure., guix-commits, 2022/08/13
- 02/12: gnu: python-pympler: Update to 1.0.1., guix-commits, 2022/08/13
- 03/12: gnu: python-dateutil: Adjust tests for Pytest 7.,
guix-commits <=
- 04/12: gnu: python-sphinx: Update to 5.1.1., guix-commits, 2022/08/13
- 12/12: gnu: texlive-hyperref: Propagate more inputs., guix-commits, 2022/08/13
- 06/12: gnu: python-freezegun: Adjust for Python 3.10., guix-commits, 2022/08/13
- 07/12: gnu: gtk-doc: Remove unused input., guix-commits, 2022/08/13
- 05/12: gnu: python-freezegun: Update to 1.2.2., guix-commits, 2022/08/13
- 10/12: gnu: python-sphinx: Add 4.5.0., guix-commits, 2022/08/13
- 09/12: gnu: gtk-doc/stable: Use 'modify-inputs'., guix-commits, 2022/08/13
- 08/12: gnu: gtk-doc: Remove input labels., guix-commits, 2022/08/13
- 11/12: gnu: python-sphinx-panels: Use python-sphinx@4., guix-commits, 2022/08/13