MCPcopy
hub / github.com/pytest-dev/pytest / undo

Function undo

src/_pytest/assertion/__init__.py:136–139  ·  src/_pytest/assertion/__init__.py::undo
()

Source from the content-addressed store, hash-verified

134 config.stash[assertstate_key].trace(class="st">"installed rewrite import hook")
135
136 def undo() -> None:
137 hook = config.stash[assertstate_key].hook
138 if hook is not None and hook in sys.meta_path:
139 sys.meta_path.remove(hook)
140
141 config.add_cleanup(undo)
142 return hook

Callers 1

test_hook_tracingMethod · 0.85

Calls 1

removeMethod · 0.80

Tested by 1

test_hook_tracingMethod · 0.68