diff --git a/s3fs/tests/test_s3fs.py b/s3fs/tests/test_s3fs.py index b243ff1f..e59512ce 100644 --- a/s3fs/tests/test_s3fs.py +++ b/s3fs/tests/test_s3fs.py @@ -166,6 +166,16 @@ def test_simple(s3): assert out == data +def test_auto_anon(s3, monkeypatch): + monkeypatch.delenv("AWS_ACCESS_KEY_ID") + monkeypatch.delenv("AWS_SECRET_ACCESS_KEY") + monkeypatch.delenv("AWS_SESSION_TOKEN") + + fs = S3FileSystem(skip_instance_cache=True, endpoint_url=endpoint_uri) + fs.s3 + assert fs.anon + + def test_with_size(s3): data = b"a" * (10 * 2**20)