Skip to content

Commit

Permalink
Check Path in confcudir parent hierarchy
Browse files Browse the repository at this point in the history
Fixes: pytest-dev#9767

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
  • Loading branch information
Akasurde committed Mar 16, 2022
1 parent f0bf4c9 commit 1f2a70d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/_pytest/config/__init__.py
Expand Up @@ -538,11 +538,7 @@ def _is_in_confcutdir(self, path: Path) -> bool:
"""
if self._confcutdir is None:
return True
try:
path.relative_to(self._confcutdir)
except ValueError:
return False
return True
return path not in self._confcutdir.parents

def _try_load_conftest(
self, anchor: Path, importmode: Union[str, ImportMode], rootpath: Path
Expand Down

0 comments on commit 1f2a70d

Please sign in to comment.