Bug 2059950 - python-dateutil fails to build with pytest 7
Summary: python-dateutil fails to build with pytest 7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-dateutil
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Haïkel Guémar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F37FTBFS PYTEST7
TreeView+ depends on / blocked
 
Reported: 2022-03-02 11:50 UTC by Miro Hrončok
Modified: 2022-03-11 07:22 UTC (History)
8 users (show)

Fixed In Version: python-dateutil-2.8.2-1.fc37
Clone Of:
Environment:
Last Closed: 2022-03-11 07:22:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2022-03-02 11:50:44 UTC
In this copr repo, I have updated pytest to 7.0.1:

https://copr.fedorainfracloud.org/coprs/churchyard/pytest-7/

Based on this PR:

https://src.fedoraproject.org/rpms/pytest/pull-request/25

I'd like to update pytest to 7 in Fedora 37, but python-dateutil 1:2.8.1-8 fails to build.


https://copr.fedorainfracloud.org/coprs/churchyard/pytest-7/package/python-dateutil/

=================================== FAILURES ===================================
_____________________ test_parser_parser_private_not_warns _____________________

    @pytest.mark.skipif(IS_PY32, reason='pytest.warns not supported on Python 3.2')
    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:

dateutil/test/test_internals.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = WarningsChecker(record=True), expected_warning = None, match_expr = None

    def __init__(
        self,
        expected_warning: Optional[
            Union[Type[Warning], Tuple[Type[Warning], ...]]
        ] = Warning,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
        *,
        _ispytest: bool = False,
    ) -> None:
        check_ispytest(_ispytest)
        super().__init__(_ispytest=True)
    
        msg = "exceptions must be derived from Warning, not %s"
        if expected_warning is None:
>           warnings.warn(WARNS_NONE_ARG, stacklevel=4)
E           pytest.PytestRemovedIn8Warning: Passing None has been deprecated.
E           See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

/usr/lib/python3.10/site-packages/_pytest/recwarn.py:246: PytestRemovedIn8Warning
=========================== short test summary info ============================
FAILED dateutil/test/test_internals.py::test_parser_parser_private_not_warns
============ 1 failed, 2009 passed, 47 skipped, 19 xfailed in 6.57s ============



This calls pytest.warns(None) which is not allowed see https://github.com/pytest-dev/pytest/issues/9002



There are several packages affected by this update, so I'd very much appreciate it if you could fix this failure. Please, check if your upstream hasn't already fixed it and backport the fix if possible. Report this failure to your upstream otherwise. If you need specific help, let me know.

Thanks!

Comment 1 Ben Beasley 2022-03-10 17:56:24 UTC
These tests were re-written for the current version of dateutil, 3.8.2[1]. I suspect that a simple upgrade to that version will resolve this issue, too. 

[1] https://github.com/dateutil/dateutil/commit/353c4af84add0a9ac47adc792867935fe631875f

Comment 2 Ben Beasley 2022-03-10 18:17:45 UTC
Sorry, this is actually not fixed in 3.8.2. It is fixed in an unreleased commit, https://github.com/dateutil/dateutil/commit/2bdd63158b7f981fc6d70a869680451bdfd8d848.

Comment 3 Ben Beasley 2022-03-10 18:34:31 UTC
The following PR should fix this and bug 1982169:

https://src.fedoraproject.org/rpms/python-dateutil/pull-request/10

Comment 4 Fedora Update System 2022-03-11 07:21:29 UTC
FEDORA-2022-2d8cecbf55 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-2d8cecbf55

Comment 5 Fedora Update System 2022-03-11 07:22:56 UTC
FEDORA-2022-2d8cecbf55 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.