tests/_utilities/fixtures/aws_s3.py
def s3():
    """Create bucket for tests if it does not already exist"""
    s3 = S3Client(DIGITALOCEAN_SPACES_KEY, DIGITALOCEAN_SPACES_SECRET)

    created_bucket = False
    if not s3.find_bucket(bucket):
        s3.create_bucket(bucket)
        created_bucket = True

    yield s3

    if created_bucket:
        s3.delete_bucket(bucket)
Create bucket for tests if it does not already exist
Create bucket for tests if it does not already exist
Create bucket for tests if it does not already exist
def s3():
    s3 = S3Client(DIGITALOCEAN_SPACES_KEY, DIGITALOCEAN_SPACES_SECRET)
    created_bucket = False
    if not s3.find_bucket(bucket):
        s3.create_bucket(bucket)
        created_bucket = True
    yield s3
    if created_bucket:
        s3.delete_bucket(bucket)
def s3 ( ) : s3 = S3Client ( DIGITALOCEAN_SPACES_KEY , DIGITALOCEAN_SPACES_SECRET ) created_bucket = False if not s3 . find_bucket ( bucket ) : s3 . create_bucket ( bucket ) created_bucket = True yield s3 if created_bucket : s3 . delete_bucket ( bucket )
Create bucket for tests if it does not already exist
Create bucket for tests if it does not already exist
"""Create bucket for tests if it does not already exist"""