Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Jul 19, 2024
1 parent 6c1869f commit b43e93e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/system/test_fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import pytest

from google.cloud.storage.fileio import CHUNK_SIZE_MULTIPLE
from .test_blob import _check_blob_hash


Expand Down Expand Up @@ -98,9 +99,9 @@ def test_blobwriter_exit(

# unhandled exceptions should cancel the upload
with pytest.raises(ValueError, match="SIGTERM received"):
with blob.open("wb") as writer:
with blob.open("wb", chunksize=CHUNK_SIZE_MULTIPLE) as writer:
writer.write(b"first chunk") # not yet uploaded
writer.write(b"big chunk" * 1024 ** 8) # uploaded
writer.write(bytes(CHUNK_SIZE_MULTIPLE)) # uploaded
raise ValueError("SIGTERM received") # upload is cancelled in __exit__
# blob should not exist
assert not blob.exists()
Expand Down

0 comments on commit b43e93e

Please sign in to comment.