From ac8da5b8d799018b3044532bcf8f62402e9c8598 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 2 Jul 2024 18:31:40 -0400 Subject: [PATCH] FIX: Where --- src/_pytest/deprecated.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 3a9c49b92..8c5b51030 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -97,7 +97,7 @@ def check_ispytest(ispytest: bool) -> None: def _warn_auto_stacklevel(message: Warning | str, category: Any = UserWarning) -> None: """Emit a warning with trace outside the pytest namespace.""" - root_dir = Path(__file__).parents[1] + root_dir = Path(__file__).parent frame = inspect.currentframe() fname, lineno = "unknown", 0 while frame: