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

Prepare for upcoming pytest 7.0 deprecations #42

Merged
merged 4 commits into from Oct 25, 2021

Conversation

bluetech
Copy link
Contributor

@bluetech bluetech commented Oct 25, 2021

This plugin has had to endure a lot of deprecations from pytest, sorry about that :(

pytest-flakes is checked as part of pytest's CI. In pytest 7.0 (previously 6.3), py.path.local-based arguments to hooks & node ctors are deprecated, so switch to the pathlib based replacements on pytest 7.

I also cleaned up some no-longer-needed backward compat checks, see the separate commits for those.

Refs pytest-dev/pytest#9232

@bluetech
Copy link
Contributor Author

I hope this can be merged and released to unblock the pytest PR. But it's OK if not, we can add an ignore on our side, it's not a problem.

@asmeurer
Copy link
Owner

Apparently we never moved this repo from Travis to GitHub Actions. We should try to do that first.

@bluetech
Copy link
Contributor Author

Sure, I'll try to do it now.

`collect` is not called on the Item, but on the File.
Since pytest-flakes depends on pytest>=5.0, the check is not necessary.
Since pytest-flakes required python>=3.5, and tokenize.open was added in
python 3.2, it's no longer needed.
pytest-flakes is checked as part of pytest's CI. In pytest 7.0
(previously 6.3), `py.path.local`-based arguments to hooks & node ctors
are deprecated, so switch to the `pathlib` based replacements on pytest
7.
@asmeurer
Copy link
Owner

Thanks. Should I make a release with this or are more changes forthcoming?

@asmeurer asmeurer merged commit 738430c into asmeurer:master Oct 25, 2021
@bluetech
Copy link
Contributor Author

Except #44, nothing more from me, thanks!

@asmeurer
Copy link
Owner

Just released 4.0.4 with your changes.

nicoddemus added a commit to nicoddemus/pytest-flakes that referenced this pull request Dec 1, 2021
This follows up asmeurer#42, we decided that using just `fspath` as the new
parameter that users should use would be confusing because it is too
close to `path` and also we have `fspath` already in some places of
the pytest public API (see pytest-dev/pytest#9283).

This PR updates the hook affected by this new change in pytest-dev/pytest#9363.
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.

None yet

2 participants