# Path: simplekv/_compat.py
# PY2 = sys.version_info[0] == 2


from simplekv._compat import ConfigParser
from contextlib import contextmanager
from uuid import uuid4 as uuid
        from boto.s3.connection import OrdinaryCallingFormat
import pytest
    import boto3


@contextmanager
def boto_bucket(access_key, secret_key, host,
                connect_func='connect_s3', ordinary_calling_format=False,
                bucket_name=None, port=None, is_secure=True):
    if ordinary_calling_format:
        conn = getattr(boto, connect_func)(access_key, secret_key, host=host,
                                           calling_format=OrdinaryCallingFormat
                                           (),
                                           port=port, is_secure=is_secure)
    else:
        conn = getattr(boto, connect_func)(access_key, secret_key, host=host,
                                           port=port, is_secure=is_secure)

    name = bucket_name or 'testrun-bucket-{}'.format(uuid())
    bucket = conn.create_bucket(name)

    yield bucket

    for key in bucket.list():
        key.delete()
    bucket.delete()

@contextmanager
def boto3_bucket(access_key, secret_key, host,
                 bucket_name=None, **kwargs):
    name = bucket_name or 'testrun-bucket-{}'.format(uuid())
    s3_client = boto3.client('s3')
    s3_client.create_bucket(Bucket=name)

# Path: simplekv/_compat.py
# PY2 = sys.version_info[0] == 2


# Path: tests/bucket_manager.py
from simplekv._compat import ConfigParser
from contextlib import contextmanager
from uuid import uuid4 as uuid
        from boto.s3.connection import OrdinaryCallingFormat
import pytest
    import boto3



@contextmanager
def boto_bucket(access_key, secret_key, host,
                connect_func='connect_s3', ordinary_calling_format=False,
                bucket_name=None, port=None, is_secure=True):
    if ordinary_calling_format:
        conn = getattr(boto, connect_func)(access_key, secret_key, host=host,
                                           calling_format=OrdinaryCallingFormat
                                           (),
                                           port=port, is_secure=is_secure)
    else:
        conn = getattr(boto, connect_func)(access_key, secret_key, host=host,
                                           port=port, is_secure=is_secure)

    name = bucket_name or 'testrun-bucket-{}'.format(uuid())
    bucket = conn.create_bucket(name)

    yield bucket

    for key in bucket.list():
        key.delete()
    bucket.delete()

@contextmanager
def boto3_bucket(access_key, secret_key, host,
                 bucket_name=None, **kwargs):
    name = bucket_name or 'testrun-bucket-{}'.format(uuid())
    s3_client = boto3.client('s3')
    s3_client.create_bucket(Bucket=name)

    s3_resource = boto3.resource('s3')