mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
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.
This commit is contained in:
parent
f561830a5b
commit
431df1214e
3 changed files with 45 additions and 0 deletions
|
@ -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 \
|
||||
|
|
43
gnu/packages/patches/python-dateutil-pytest-compat.patch
Normal file
43
gnu/packages/patches/python-dateutil-pytest-compat.patch
Normal file
|
@ -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
|
|
@ -196,6 +196,7 @@ (define-public python-dateutil
|
|||
(origin
|
||||
(method url-fetch)
|
||||
(uri (pypi-uri "python-dateutil" version))
|
||||
(patches (search-patches "python-dateutil-pytest-compat.patch"))
|
||||
(sha256
|
||||
(base32
|
||||
"11iy7m4bp2lgfkcl0r6xzf34bvk7ppjmsyn2ygfikbi72v6cl8q1"))))
|
||||
|
|
Loading…
Reference in a new issue