diff --git a/_pytest/main.py b/_pytest/main.py index 1caa7ff1e..f2d4b0155 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -170,7 +170,7 @@ def _in_venv(path): """Attempts to detect if ``path`` is the root of a Virtual Environment by checking for the existence of the appropriate activate script""" bindir = path.join('Scripts' if sys.platform.startswith('win') else 'bin') - if not bindir.exists(): + if not bindir.isdir(): return False activates = ('activate', 'activate.csh', 'activate.fish', 'Activate', 'Activate.bat', 'Activate.ps1') diff --git a/changelog/3241.bugfix.rst b/changelog/3241.bugfix.rst new file mode 100644 index 000000000..2b8b07d83 --- /dev/null +++ b/changelog/3241.bugfix.rst @@ -0,0 +1,2 @@ +Refactor check of bindir from ``exists`` to ``isdir`` regarding `#3241 `_. +