Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pytest_ignore_collect not to block default pytest code #464

Merged
merged 3 commits into from
Nov 3, 2024

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented May 28, 2024

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 pytest-dev/pytest#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):

  • You've added tests (in tests/) added which would fail without your patch
  • You've updated the documentation (in docs/, in case of behavior changes or new
    features)
  • You've added a new changelog entry (in docs/versionhistory.rst).

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.

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 pytest-dev/pytest#12383
about the misleading documentation.
@coveralls
Copy link

Coverage Status

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

@coveralls
Copy link

coveralls commented Nov 3, 2024

Coverage Status

coverage: 94.511%. remained the same
when pulling 4b9f659 on mgorny:pytest-collect-ignore
into 6d6b4de on agronholm:master.

@agronholm agronholm merged commit 1c53caa into agronholm:master Nov 3, 2024
9 checks passed
@agronholm
Copy link
Owner

Thanks! But next time, please add a changelog entry yourself so I won't have to.

@mgorny
Copy link
Contributor Author

mgorny commented Nov 3, 2024

Ah, sorry. I guess I thought that it's not a "user-facing change", since it's just the test suite.

Thanks!

@mgorny mgorny deleted the pytest-collect-ignore branch November 3, 2024 12:46
@agronholm
Copy link
Owner

Ah, sorry. I guess I thought that it's not a "user-facing change", since it's just the test suite.

Thanks!

Sorry, this was my mistake. The changelog entry I added is invalid.

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.

3 participants