Closed amolenaar closed 2 years ago
Thank you for the PR. Definitely want to get this fixed.
Does the minimum version of pytest need to be updated in requirements/tests.txt
?
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?
Good point. From what I read in the docs, the file_path
attribute was only added in Pytest 7.0. That would imply this PR breaks with any version of Pytest < 7.0 :disappointed:.
Merging #119 (d000246) into main (4ef9b23) will decrease coverage by
2.46%
. The diff coverage is100.00%
.
@@ 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: if pytest.__version__ < '7.':
is that robust to edge cases? Would something like distutils.version.LooseVersion or packaging.version.Version
?
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.