@pytest.fixture
def test_bucket(cloud_config):
 bucket = storage.Client().bucket(cloud_config.storage_bucket)
 acl = google.cloud.storage.acl.BucketACL(bucket)
 object_default_acl = google.cloud.storage.acl.DefaultObjectACL(bucket)
 acl.reload()
 object_default_acl.reload()
 (yield bucket)
 acl.save()
 object_default_acl.save()

@ pytest . fixture def test_bucket ( cloud_config ) : bucket = storage . Client ( ) . bucket ( cloud_config . storage_bucket ) acl = google . cloud . storage . acl . BucketACL ( bucket ) object_default_acl = google . cloud . storage . acl . DefaultObjectACL ( bucket ) acl . reload ( ) object_default_acl . reload ( ) ( yield bucket ) acl . save ( ) object_default_acl . save ( )
yields a bucket that resets its acl after the test completes .