Bug 2275086 - python-papermill fails to build with pytest 8: TypeError: exceptions must be derived from Warning, not <class 'NoneType'>
Summary: python-papermill fails to build with pytest 8: TypeError: exceptions must be ...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-papermill
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ankur Sinha (FranciscoD)
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 2256331
TreeView+ depends on / blocked
 
Reported: 2024-04-15 10:05 UTC by Tomáš Hrnčiar
Modified: 2024-04-19 11:42 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-04-19 11:42:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2024-04-15 10:05:51 UTC
python-papermill fails to build with pytest 8.

=================================== FAILURES ===================================
_____________ TestPapermillIO.test_read_with_valid_file_extension ______________
[gw0] linux -- Python 3.12.2 /usr/bin/python3

self = <papermill.tests.test_iorw.TestPapermillIO testMethod=test_read_with_valid_file_extension>

    def test_read_with_valid_file_extension(self):
>       with pytest.warns(None) as warns:

papermill/tests/test_iorw.py:150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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

    def __init__(
        self,
        expected_warning: 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 isinstance(expected_warning, tuple):
            for exc in expected_warning:
                if not issubclass(exc, Warning):
                    raise TypeError(msg % type(exc))
            expected_warning_tup = expected_warning
        elif isinstance(expected_warning, type) and issubclass(
            expected_warning, Warning
        ):
            expected_warning_tup = (expected_warning,)
        else:
>           raise TypeError(msg % type(expected_warning))
E           TypeError: exceptions must be derived from Warning, not <class 'NoneType'>

/usr/lib/python3.12/site-packages/_pytest/recwarn.py:285: TypeError
=========================== short test summary info ============================
FAILED papermill/tests/test_iorw.py::TestPapermillIO::test_read_with_valid_file_extension
=========== 1 failed, 496 passed, 2 skipped, 692 warnings in 27.69s ============

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07248498-python-papermill/

For all our attempts to build python-papermill with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/python-papermill/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.


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