From 495a6a8d5fbca442755956ca635ea2316d1638d5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 6 Apr 2024 12:27:04 -0300 Subject: [PATCH] Raname path -> module_path for clarity --- src/_pytest/pathlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index b83619f56..ff12eb453 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -818,10 +818,10 @@ def is_importable(root: Path, module_path: Path) -> bool: return spec_matches_module_path(spec, module_path) -def compute_module_name(root: Path, path: Path) -> str: +def compute_module_name(root: Path, module_path: Path) -> str: """Compute a module name based on a path and a root anchor.""" try: - path_without_suffix = path.with_suffix("") + path_without_suffix = module_path.with_suffix("") except ValueError: # Empty paths (such as Path.cwd()) might break meta_path hooks (like our own assertion rewriter). return ""