config: fix incorrect cache hit check in _getconftestmodules

This made the cache not work as intended, causing a major slowdown.

See #9478 for discussion and context.

Authored-by: Anthony Sottile <asottile@umich.edu>
This commit is contained in:
Ran Benita 2022-01-07 12:15:34 +02:00
parent 71baf24b6d
commit b19374bc19
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ class PytestPluginManager(PluginManager):
# Optimization: avoid repeated searches in the same directory. # Optimization: avoid repeated searches in the same directory.
# Assumes always called with same importmode and rootpath. # Assumes always called with same importmode and rootpath.
existing_clist = self._dirpath2confmods.get(directory) existing_clist = self._dirpath2confmods.get(directory)
if existing_clist: if existing_clist is not None:
return existing_clist return existing_clist
# XXX these days we may rather want to use config.rootpath # XXX these days we may rather want to use config.rootpath