Skip to content

Commit b19374b

Browse files
committed
config: fix incorrect cache hit check in _getconftestmodules
This made the cache not work as intended, causing a major slowdown. See pytest-dev#9478 for discussion and context. Authored-by: Anthony Sottile <[email protected]>
1 parent 71baf24 commit b19374b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def _getconftestmodules(
538538
# Optimization: avoid repeated searches in the same directory.
539539
# Assumes always called with same importmode and rootpath.
540540
existing_clist = self._dirpath2confmods.get(directory)
541-
if existing_clist:
541+
if existing_clist is not None:
542542
return existing_clist
543543

544544
# XXX these days we may rather want to use config.rootpath

0 commit comments

Comments
 (0)