Skip to content

Commit fdec840

Browse files
committed
add docstring
1 parent 784ac42 commit fdec840

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/unit/test_mock_s3.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ def spoof_s3(bucket, file_name, file_path):
3232
print(os.path.isfile(target_file))
3333

3434
# "access" file "remotely" with s3fs
35-
fs = s3fs.S3FileSystem()
35+
fs = s3fs.S3FileSystem(anon=True)
3636
with open('testobj.nc', 'wb') as ncdata:
3737
object.download_fileobj(ncdata)
3838
with open('testobj.nc', 'rb') as ncdata:
3939
ncfile = h5netcdf.File(ncdata, 'r', invalid_netcdf=True)
4040
print(ncfile) # it works but...
41+
# correct coupling between boto3 and s3fs requires yielding
42+
# an s3fs Filesystem,
43+
# see https://stackoverflow.com/questions/75902766/how-to-access-my-own-fake-bucket-with-s3filesystem-pytest-and-moto
4144

4245
return res
4346

0 commit comments

Comments
 (0)