From 056d9e8dc232229fc9c0e86b26d43f9c000656fa Mon Sep 17 00:00:00 2001 From: Maik Figura Date: Sun, 4 Mar 2018 00:55:04 +0100 Subject: [PATCH 1/2] Use `isdir` instead of `exists` --- _pytest/main.py | 2 +- changelog/3241.bugfix.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/3241.bugfix.rst 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..32d85c2b8 --- /dev/null +++ b/changelog/3241.bugfix.rst @@ -0,0 +1,2 @@ +Refactor check of bindir from `exists` to `isdir`. + From 9a2e0c061d0a51c6a4f08c8b8f609fd04ac10ce7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 3 Mar 2018 23:14:57 -0300 Subject: [PATCH 2/2] Update 3241.bugfix.rst --- changelog/3241.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/3241.bugfix.rst b/changelog/3241.bugfix.rst index 32d85c2b8..2b8b07d83 100644 --- a/changelog/3241.bugfix.rst +++ b/changelog/3241.bugfix.rst @@ -1,2 +1,2 @@ -Refactor check of bindir from `exists` to `isdir`. +Refactor check of bindir from ``exists`` to ``isdir`` regarding `#3241 `_.