Skip to content

Conversation

@andy-slac
Copy link
Contributor

The patch allows suppressing ResourceWarnings from sqlite3 by specifying filter on command line with -W option.

In our project we have multiple packages with separate pyproject.toml file (or even without it). Our build system runs pytest on each of the packages, the only way for us to suppress ResourceWarnings from sqlite3 is to pass the filter on the command line. This unfortunately does not work, as command line filter is escaped before compiled to regex, and escaped regex does not match non-escaped one that pytest-cov tries to match. I am adding an escaped message to the check so that both variants are checked.

And in general, I do not think it was a good idea for pytest-cov to enable one specific ResourceWarning warning. People who care about super-clean code just use default filter or ResourceWarning with empty message. In our case we do use -Wd, but we cannot fix sqlite3 warnings as they come from sqlalchemy which has no easy way to close all connections in connection pool (but it is safe to garbage-collect them).

The patch allows suppressing ResourceWarnings from sqlite3 by
specifying filter in command line with -W option.
@andy-slac
Copy link
Contributor Author

Not sure why tests/check is failing, can't see any hint in the log. My change is trivial, I don't think it could trigger failure. Could someone check?

@ionelmc ionelmc merged commit 57e3fe1 into pytest-dev:master Nov 8, 2025
29 of 31 checks passed
@ionelmc
Copy link
Member

ionelmc commented Nov 8, 2025

schemastore.org is down, i just need to figure out how or if it's even worth running taplo-lint at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants