fix: retain conflicting saves and preserve list content in Word
This commit is contained in:
@@ -53,9 +53,9 @@ def test_publication_cancellation_race_and_rollback(tmp_path, monkeypatch):
|
||||
with pytest.raises(OSError, match='发生变化'): publish_outputs(outputs, expected, tmp_path)
|
||||
destinations[0].write_bytes(b'old')
|
||||
real_write = batch_documents.atomic_write
|
||||
def fail(path, data):
|
||||
def fail(path, data, **kwargs):
|
||||
if path == destinations[1] and data == b'new': raise OSError('disk full')
|
||||
real_write(path, data)
|
||||
real_write(path, data, **kwargs)
|
||||
monkeypatch.setattr(batch_documents, 'atomic_write', fail)
|
||||
with pytest.raises(OSError, match='disk full'): publish_outputs(outputs, expected, tmp_path)
|
||||
assert all(path.read_bytes() == b'old' for path in destinations)
|
||||
|
||||
Reference in New Issue
Block a user