Skip to content

Commit 918ac98

Browse files
committed
test(perf): return number of bytes written in _DummyListBuffer.write
Also fixed a pre-existing lint error (unused import io.BytesIO).
1 parent 7fc3100 commit 918ac98

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • packages/google-cloud-storage/tests/perf/microbenchmarks/time_based/reads

packages/google-cloud-storage/tests/perf/microbenchmarks/time_based/reads/test_reads.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import os
2020
import random
2121
import time
22-
from io import BytesIO
2322

2423
import pytest
2524

@@ -126,7 +125,9 @@ def __init__(self):
126125

127126
def write(self, data):
128127
self.chunks.append(data)
129-
self.size += len(data)
128+
nbytes = len(data)
129+
self.size += nbytes
130+
return nbytes
130131

131132
def getvalue(self):
132133
return b"".join(self.chunks)

0 commit comments

Comments
 (0)