diff --git a/pyproject.toml b/pyproject.toml index 0e1b01a..d59722f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,7 +139,7 @@ extra-dependencies = [ "pytest-xdist", "textual", - "mutmut @ {root:uri}/../mutmut" + "mutmut @ {root:uri}/../mutmut" ] [[tool.hatch.envs.types.matrix]] diff --git a/src/inline_snapshot/_inline_snapshot.py b/src/inline_snapshot/_inline_snapshot.py index c91a8a9..21dd39c 100644 --- a/src/inline_snapshot/_inline_snapshot.py +++ b/src/inline_snapshot/_inline_snapshot.py @@ -567,10 +567,16 @@ def snapshot(obj: Any = undefined) -> Any: return obj frame = inspect.currentframe() + assert frame is not None frame = frame.f_back + while "mutmut" in frame.f_code.co_name: + frame = frame.f_back + assert frame is not None frame = frame.f_back + while "mutmut" in frame.f_code.co_name: + frame = frame.f_back assert frame is not None expr = Source.executing(frame)