()
| 363 | |
| 364 | |
| 365 | def test_undo_class_descriptors_delattr() -> None: |
| 366 | class SampleParent: |
| 367 | @classmethod |
| 368 | def hello(_cls): |
| 369 | pass |
| 370 | |
| 371 | @staticmethod |
| 372 | def world(): |
| 373 | pass |
| 374 | |
| 375 | class SampleChild(SampleParent): |
| 376 | pass |
| 377 | |
| 378 | monkeypatch = MonkeyPatch() |
| 379 | |
| 380 | original_hello = SampleChild.hello |
| 381 | original_world = SampleChild.world |
| 382 | monkeypatch.delattr(SampleParent, "hello") |
| 383 | monkeypatch.delattr(SampleParent, "world") |
| 384 | assert getattr(SampleParent, "hello", None) is None |
| 385 | assert getattr(SampleParent, "world", None) is None |
| 386 | |
| 387 | monkeypatch.undo() |
| 388 | assert original_hello == SampleChild.hello |
| 389 | assert original_world == SampleChild.world |
| 390 | |
| 391 | |
| 392 | def test_issue1338_name_resolving() -> None: |
nothing calls this directly
no test coverage detected