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

Function test_issue156_undo_staticmethod

testing/test_monkeypatch.py:384–391  ·  view source on GitHub ↗
(Sample: type[Sample])

Source from the content-addressed store, hash-verified

382 ids=["new", "new-inherit"],
383)
384def test_issue156_undo_staticmethod(Sample: type[Sample]) -> None:
385 monkeypatch = MonkeyPatch()
386
387 monkeypatch.setattr(Sample, "hello", None)
388 assert Sample.hello is None
389
390 monkeypatch.undo() # type: ignore[unreachable]
391 assert Sample.hello()
392
393
394def test_undo_class_descriptors_delattr() -> None:

Callers

nothing calls this directly

Calls 4

setattrMethod · 0.95
undoMethod · 0.95
MonkeyPatchClass · 0.90
helloMethod · 0.45

Tested by

no test coverage detected