MCPcopy Create free account
hub / github.com/dask/dask / s3_context

Function s3_context

dask/bytes/tests/test_s3.py:123–136  ·  view source on GitHub ↗
(bucket=test_bucket_name, files=files)

Source from the content-addressed store, hash-verified

121
122@contextmanager
123def s3_context(bucket=test_bucket_name, files=files):
124 client = boto3.client("s3", endpoint_url=endpoint_uri)
125 client.create_bucket(Bucket=bucket, ACL="public-read-write")
126 for f, data in files.items():
127 client.put_object(Bucket=bucket, Key=f, Body=data)
128 fs = s3fs.S3FileSystem(
129 anon=True, client_kwargs={"endpoint_url": "http://127.0.0.1:5555/"}
130 )
131 s3fs.S3FileSystem.clear_instance_cache()
132 fs.invalidate_cache()
133 try:
134 yield fs
135 finally:
136 fs.rm(bucket, recursive=True)
137
138
139@pytest.fixture()

Callers 3

s3Function · 0.85
test_compressionFunction · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected