agronholm / typeguard

Run-time type checker for Python
Other
1.5k stars 112 forks source link

Fix `pytest_ignore_collect` not to block default pytest code #464

Open mgorny opened 3 months ago

mgorny commented 3 months ago

Changes

Fix pytest_ignore_collect hook implementation to return None rather than False when the path ought not to be ignored. This is necessary to enable the default pytest implementation of pytest_ignore_collect() to be used. Otherwise, the default rules are never applied and e.g. --ignore does not work.

I've also reported https://github.com/pytest-dev/pytest/issues/12383 about the misleading documentation.

Checklist

If this is a user-facing code change, like a bugfix or a new feature, please ensure that you've fulfilled the following conditions (where applicable):

If this is a trivial change, like a typo fix or a code reformatting, then you can ignore these instructions.

Updating the changelog

If there are no entries after the last release, use **UNRELEASED** as the version. If, say, your patch fixes issue #999, the entry should look like this:

* Fix big bad boo-boo in the pytest plugin (#999 <https://github.com/agronholm/typeguard/issues/999>_; PR by @yourgithubaccount)

If there's no issue linked, just link to your pull request instead by updating the changelog after you've created the PR.

coveralls commented 3 months ago

Coverage Status

coverage: 94.139%. remained the same when pulling 4e2871379b0ab6cc0f23cb26dd891c6873418fe9 on mgorny:pytest-collect-ignore into 016f8139f5a0a63147d68df9558cc5584cd2c49a on agronholm:master.