()
| 179 | |
| 180 | |
| 181 | def test_delitem() -> None: |
| 182 | d: dict[str, object] = {"x": 1} |
| 183 | monkeypatch = MonkeyPatch() |
| 184 | monkeypatch.delitem(d, "x") |
| 185 | assert "x" not in d |
| 186 | monkeypatch.delitem(d, "y", raising=False) |
| 187 | with pytest.raises(KeyError): |
| 188 | monkeypatch.delitem(d, "y") |
| 189 | assert not d |
| 190 | monkeypatch.setitem(d, "y", 1700) |
| 191 | assert d["y"] == 1700 |
| 192 | d["hello"] = "world" |
| 193 | monkeypatch.setitem(d, "x", 1500) |
| 194 | assert d["x"] == 1500 |
| 195 | monkeypatch.undo() |
| 196 | assert d == {"hello": "world", "x": 1} |
| 197 | |
| 198 | |
| 199 | def test_setenv() -> None: |
nothing calls this directly
no test coverage detected