Skip to content

CI: Make uncaught warnings raise as errors #19677

Closed
@TomAugspurger

Description

@TomAugspurger

By adding

filterwarnings =
    error

to our setup.cfg, we can easily make uncaught warnings turn into errors. What are people's thoughts on this? The only downside I see is that contributor's PR will fail due to unrelated changes to a downstream package, but we can quickly fix those.

It seems like uses of

with warnings.catch_warnings(record=True):
   ...

does not work with however pytest is asserting that warnings haven't gotten through. We need to actually use tm.assert_produces_warning or pytest.warns, so it'll be a bit of work to transition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous Integration

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions