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 8 compatibility #119
Conversation
Thank you for the PR. Definitely want to get this fixed. Does the minimum version of pytest need to be updated in I'm also not sure why the dashboards aren't running. I just merged dev/0.5.11 into main, which adds support for "loose" and "strict" requirement tests. (i.e. strict runs with minimum versions of everything, and loose runs with latest versions of everything). We need to ensure this doesn't break anyone using minimum versions. Can you rebase on the latest main and see if that causes the dashboards to run? |
Pytest is moving away from `py.path.local` to `pathlib`. This causes warnings when running tests on Pytest 7.
4523c75
to
3864eef
Compare
Good point. From what I read in the docs, the |
8d5dfee
to
8713b01
Compare
The new form (using Pathlib) is introduced in Pytest 7. We still want to support older versions.
8713b01
to
d000246
Compare
Codecov Report
@@ Coverage Diff @@
## main #119 +/- ##
==========================================
- Coverage 84.24% 81.78% -2.47%
==========================================
Files 26 26
Lines 3022 3025 +3
Branches 666 643 -23
==========================================
- Hits 2546 2474 -72
- Misses 376 448 +72
- Partials 100 103 +3 |
LGTM. Last question: |
I tested the above question. Looks like that code is robust without requiring extra imports. Thanks for the patch! |
Pytest is moving away from
py.path.local
topathlib.Path
.This causes warnings when running tests on Pytest 7:
See also https://docs.pytest.org/en/7.0.x/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path.
This PR changes the
pytest_collect_file
function to use the pathlib path objects instead.