(tmp_path, monkeypatch, capsys)
| 182 | |
| 183 | |
| 184 | def test_disk_full(tmp_path, monkeypatch, capsys): |
| 185 | sa = save.Save() |
| 186 | with taddons.context(sa) as tctx: |
| 187 | tctx.configure(sa, save_stream_file=str(tmp_path / "foo.txt")) |
| 188 | |
| 189 | def _raise(*_): |
| 190 | raise OSError("wat") |
| 191 | |
| 192 | monkeypatch.setattr(sa, "maybe_rotate_to_new_file", _raise) |
| 193 | |
| 194 | f = tflow.tflow(resp=True) |
| 195 | sa.request(f) |
| 196 | with pytest.raises(SystemExit): |
| 197 | sa.response(f) |
| 198 | |
| 199 | assert "Error while writing" in capsys.readouterr().err |