MCPcopy
hub / github.com/dask/dask / s3_context

Function s3_context

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

Source from the content-addressed store, hash-verified

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

Callers 3

s3Function · 0.85
test_compressionFunction · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…