Check Path in confcudir parent hierarchy

Fixes: #9767

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2022-03-16 17:52:04 +05:30
parent f0bf4c9681
commit 1f2a70d586
1 changed files with 1 additions and 5 deletions

View File

@ -538,11 +538,7 @@ class PytestPluginManager(PluginManager):
""" """
if self._confcutdir is None: if self._confcutdir is None:
return True return True
try: return path not in self._confcutdir.parents
path.relative_to(self._confcutdir)
except ValueError:
return False
return True
def _try_load_conftest( def _try_load_conftest(
self, anchor: Path, importmode: Union[str, ImportMode], rootpath: Path self, anchor: Path, importmode: Union[str, ImportMode], rootpath: Path