Skip to content

Commit

Permalink
fix: skip mutmut frames
Browse files Browse the repository at this point in the history
  • Loading branch information
15r10nk committed Oct 22, 2024
1 parent 4f2810b commit 70ca885
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ extra-dependencies = [

"pytest-xdist",
"textual",
"mutmut @ {root:uri}/../mutmut"
"mutmut @ {root:uri}/../mutmut"
]

[[tool.hatch.envs.types.matrix]]
Expand Down
6 changes: 6 additions & 0 deletions src/inline_snapshot/_inline_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 70ca885

Please sign in to comment.