From ec387beadcd10fdcbd6a9b72fa77822512450352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Hovm=C3=B6ller?= Date: Tue, 14 Jan 2025 03:15:29 +0100 Subject: [PATCH] Crash with error message on invalid imports for `src` module --- mutmut/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mutmut/__main__.py b/mutmut/__main__.py index d4bf2c01..a3e37ebc 100644 --- a/mutmut/__main__.py +++ b/mutmut/__main__.py @@ -135,6 +135,7 @@ def guess_paths_to_mutate(): def record_trampoline_hit(name): + assert not name.startswith('src.'), f'Failed trampoline hit. Module name starts with `src.`, which is invalid' if mutmut.config.max_stack_depth != -1: f = inspect.currentframe() c = mutmut.config.max_stack_depth