Bug 2059974 - python-trio fails to build with pytest 7
Summary: python-trio fails to build with pytest 7
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-trio
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F37FTBFS PYTEST7
TreeView+ depends on / blocked
 
Reported: 2022-03-02 12:25 UTC by Miro Hrončok
Modified: 2022-04-21 17:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-21 15:13:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2022-03-02 12:25:49 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-trio 0.19.0-2 fails to build.

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


=================================== FAILURES ===================================
______________________ test_warn_set_wakeup_fd_overwrite _______________________

    def test_warn_set_wakeup_fd_overwrite():
        assert signal.set_wakeup_fd(-1) == -1
    
        async def trio_main(in_host):
            return "ok"
    
        a, b = socket.socketpair()
        with a, b:
            a.setblocking(False)
    
            # Warn if there's already a wakeup fd
            signal.set_wakeup_fd(a.fileno())
            try:
                with pytest.warns(RuntimeWarning, match="signal handling code.*collided"):
                    assert trivial_guest_run(trio_main) == "ok"
            finally:
                assert signal.set_wakeup_fd(-1) == a.fileno()
    
            signal.set_wakeup_fd(a.fileno())
            try:
                with pytest.warns(RuntimeWarning, match="signal handling code.*collided"):
                    assert (
                        trivial_guest_run(trio_main, host_uses_signal_set_wakeup_fd=False)
                        == "ok"
                    )
            finally:
                assert signal.set_wakeup_fd(-1) == a.fileno()
    
            # Don't warn if there isn't already a wakeup fd
>           with pytest.warns(None) as record:

trio/_core/tests/test_guest_mode.py:170: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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


This looks like pytest.warns(None) and that does not work, 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 Tomáš Hrnčiar 2022-04-21 15:13:57 UTC
The following builds were made after this report was opened: python-trio-0.20.0-2.fc37

Comment 2 Carl George 🤠 2022-04-21 17:06:54 UTC
This was fixed upstream in https://github.com/python-trio/trio/commit/8bd7f47b96f2a6c41d28fb9b343156afdae93943 which is part of the v0.20.0 tag.


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