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

Method test_delattr

testing/test_monkeypatch.py:109–114  ·  view source on GitHub ↗
(self, monkeypatch: MonkeyPatch)

Source from the content-addressed store, hash-verified

107 monkeypatch.undo()
108
109 def test_delattr(self, monkeypatch: MonkeyPatch) -> None:
110 with monkeypatch.context() as mp:
111 mp.delattr("os.path.abspath")
112 assert not hasattr(os.path, "abspath")
113 mp.undo()
114 assert os.path.abspath # type:ignore[truthy-function]
115
116
117def test_delattr() -> None:

Callers

nothing calls this directly

Calls 3

contextMethod · 0.80
delattrMethod · 0.80
undoMethod · 0.80

Tested by

no test coverage detected