summaryrefslogtreecommitdiff
path: root/changelog
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2020-10-19 18:34:03 +0300
committerRan Benita <ran@unusedvar.com>2020-10-19 19:02:43 +0300
commitafaabdda8cdf2b1e333a4aad550e5750d2ecd510 (patch)
tree6460378d5922e595e69643a3ac693839ac177a90 /changelog
parentf453460ae7618df34d2645266f9811dd3c39090e (diff)
downloadpytest-afaabdda8cdf2b1e333a4aad550e5750d2ecd510.tar.gz
cacheprovider: fix some files in packages getting lost from --lf
--lf has an optimization where it skips collecting Modules (python files) which don't contain failing tests. The optimization works by getting the paths of all cached failed tests and skipping the collection of Modules whose path is not included in that list. In pytest, Package nodes are Module nodes with the fspath being the file `<package dir>/__init__.py`. Since it's a Module the logic above triggered for it, and because it's an `__init__.py` file which is unlikely to have any failing tests in it, it is skipped, which causes its entire directory to be skipped, including any Modules inside it with failing tests. Fix by special-casing Packages to never filter. This means entire Packages are never filtered, the Modules themselves are always checked. It is reasonable to consider an optimization which does filter entire packages bases on parent paths etc. but this wouldn't actually save any real work so is really not worth it.
Diffstat (limited to 'changelog')
-rw-r--r--changelog/7758.bugfix.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/changelog/7758.bugfix.rst b/changelog/7758.bugfix.rst
new file mode 100644
index 000000000..a3119b46c
--- /dev/null
+++ b/changelog/7758.bugfix.rst
@@ -0,0 +1 @@
+Fixed an issue where some files in packages are getting lost from ``--lf`` even though they contain tests that failed. Regressed in pytest 5.4.0.