Skip to content

Commit 4f011f6

Browse files
committed
use yield and staticmethod
1 parent 22c0a64 commit 4f011f6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/remotes.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,15 @@ def remote(cls):
241241
remote = RemoteS3(None, {"url": cls.get_url()})
242242
yield remote
243243

244-
@classmethod
245-
def put_objects(cls, remote, objects):
244+
@staticmethod
245+
def put_objects(remote, objects):
246246
s3 = remote.s3
247247
bucket = remote.path_info.bucket
248248
s3.create_bucket(Bucket=bucket)
249249
for key, body in objects.items():
250250
s3.put_object(
251251
Bucket=bucket, Key=(remote.path_info / key).path, Body=body
252252
)
253-
yield
254253

255254

256255
class GCP:
@@ -263,13 +262,12 @@ def remote(cls):
263262
remote = RemoteGS(None, {"url": cls.get_url()})
264263
yield remote
265264

266-
@classmethod
267-
def put_objects(cls, remote, objects):
265+
@staticmethod
266+
def put_objects(remote, objects):
268267
client = remote.gs
269268
bucket = client.get_bucket(remote.path_info.bucket)
270269
for key, body in objects.items():
271270
bucket.blob((remote.path_info / key).path).upload_from_string(body)
272-
yield
273271

274272

275273
class Azure:

0 commit comments

Comments
 (0)