()
| 111 | |
| 112 | |
| 113 | def test_setitem() -> None: |
| 114 | d = {"x": 1} |
| 115 | monkeypatch = MonkeyPatch() |
| 116 | monkeypatch.setitem(d, "x", 2) |
| 117 | monkeypatch.setitem(d, "y", 1700) |
| 118 | monkeypatch.setitem(d, "y", 1700) |
| 119 | assert d["x"] == 2 |
| 120 | assert d["y"] == 1700 |
| 121 | monkeypatch.setitem(d, "x", 3) |
| 122 | assert d["x"] == 3 |
| 123 | monkeypatch.undo() |
| 124 | assert d["x"] == 1 |
| 125 | assert "y" not in d |
| 126 | d["x"] = 5 |
| 127 | monkeypatch.undo() |
| 128 | assert d["x"] == 5 |
| 129 | |
| 130 | |
| 131 | def test_setitem_deleted_meanwhile() -> None: |
nothing calls this directly
no test coverage detected