From eab0eb34d2abfc41b71a3bb8b74a38cbde6983a2 Mon Sep 17 00:00:00 2001 From: Zach Snicker Date: Fri, 28 Jun 2024 22:43:29 +0530 Subject: [PATCH] Use .is_file in place of .exists --- src/_pytest/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 0b9e64e2f..efc613910 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -371,7 +371,7 @@ def _in_venv(path: Path) -> bool: """Attempt to detect if ``path`` is the root of a Virtual Environment by checking for the existence of the pyvenv.cfg file.""" try: - return path.joinpath("pyvenv.cfg").exists() + return path.joinpath("pyvenv.cfg").is_file() except OSError: return False