()
| 136 | |
| 137 | |
| 138 | def test_setitem() -> None: |
| 139 | d = {"x": 1} |
| 140 | monkeypatch = MonkeyPatch() |
| 141 | monkeypatch.setitem(d, "x", 2) |
| 142 | monkeypatch.setitem(d, "y", 1700) |
| 143 | monkeypatch.setitem(d, "y", 1700) |
| 144 | assert d["x"] == 2 |
| 145 | assert d["y"] == 1700 |
| 146 | monkeypatch.setitem(d, "x", 3) |
| 147 | assert d["x"] == 3 |
| 148 | monkeypatch.undo() |
| 149 | assert d["x"] == 1 |
| 150 | assert "y" not in d |
| 151 | d["x"] = 5 |
| 152 | monkeypatch.undo() |
| 153 | assert d["x"] == 5 |
| 154 | |
| 155 | |
| 156 | def test_setitem_deleted_meanwhile() -> None: |
nothing calls this directly
no test coverage detected