()
| 154 | |
| 155 | |
| 156 | def test_delitem() -> None: |
| 157 | d: Dict[str, object] = {"x": 1} |
| 158 | monkeypatch = MonkeyPatch() |
| 159 | monkeypatch.delitem(d, "x") |
| 160 | assert "x" not in d |
| 161 | monkeypatch.delitem(d, "y", raising=False) |
| 162 | pytest.raises(KeyError, monkeypatch.delitem, d, "y") |
| 163 | assert not d |
| 164 | monkeypatch.setitem(d, "y", 1700) |
| 165 | assert d["y"] == 1700 |
| 166 | d["hello"] = "world" |
| 167 | monkeypatch.setitem(d, "x", 1500) |
| 168 | assert d["x"] == 1500 |
| 169 | monkeypatch.undo() |
| 170 | assert d == {"hello": "world", "x": 1} |
| 171 | |
| 172 | |
| 173 | def test_setenv() -> None: |
nothing calls this directly
no test coverage detected