From cfa51788a682c4f09f5e17f9cb4e56a4469b79b3 Mon Sep 17 00:00:00 2001 From: GergelyKalmar Date: Sat, 20 Aug 2022 14:25:20 +0200 Subject: [PATCH] Ignore editable installation modules --- src/_pytest/config/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index b3173d7d7..d0f0402ba 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -836,7 +836,8 @@ def _iter_rewritable_modules(package_files: Iterable[str]) -> Iterator[str]: if is_simple_module: module_name, _ = os.path.splitext(fn) # we ignore "setup.py" at the root of the distribution - if module_name != "setup": + # as well as editable installation finder modules made by setuptools + if module_name != "setup" and not module_name.startswith('__editable__'): seen_some = True yield module_name elif is_package: