From 4f011f62c76eb562677a2a1d3ab03b98203a65cc Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Sun, 1 Dec 2019 16:24:22 +0545 Subject: [PATCH] use yield and staticmethod --- tests/remotes.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/remotes.py b/tests/remotes.py index 4c0d77660..679f3f93b 100644 --- a/tests/remotes.py +++ b/tests/remotes.py @@ -241,8 +241,8 @@ class S3Mocked: remote = RemoteS3(None, {"url": cls.get_url()}) yield remote - @classmethod - def put_objects(cls, remote, objects): + @staticmethod + def put_objects(remote, objects): s3 = remote.s3 bucket = remote.path_info.bucket s3.create_bucket(Bucket=bucket) @@ -250,7 +250,6 @@ class S3Mocked: s3.put_object( Bucket=bucket, Key=(remote.path_info / key).path, Body=body ) - yield class GCP: @@ -263,13 +262,12 @@ class GCP: remote = RemoteGS(None, {"url": cls.get_url()}) yield remote - @classmethod - def put_objects(cls, remote, objects): + @staticmethod + def put_objects(remote, objects): client = remote.gs bucket = client.get_bucket(remote.path_info.bucket) for key, body in objects.items(): bucket.blob((remote.path_info / key).path).upload_from_string(body) - yield class Azure: