MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_issue156_undo_staticmethod

Function test_issue156_undo_staticmethod

testing/test_monkeypatch.py:355–362  ·  view source on GitHub ↗
(Sample: Type[Sample])

Source from the content-addressed store, hash-verified

353 ids=["new", "new-inherit"],
354)
355def test_issue156_undo_staticmethod(Sample: Type[Sample]) -> None:
356 monkeypatch = MonkeyPatch()
357
358 monkeypatch.setattr(Sample, "hello", None)
359 assert Sample.hello is None
360
361 monkeypatch.undo() # type: ignore[unreachable]
362 assert Sample.hello()
363
364
365def 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