()
| 2109 | |
| 2110 | @pytest.mark.s3 |
| 2111 | def test_s3_finalize(): |
| 2112 | # Once finalize_s3() was called, most/all operations on S3 filesystems |
| 2113 | # should raise. |
| 2114 | code = """if 1: |
| 2115 | import pytest |
| 2116 | from pyarrow.fs import (FileSystem, S3FileSystem, |
| 2117 | ensure_s3_initialized, finalize_s3) |
| 2118 | |
| 2119 | fs, path = FileSystem.from_uri('s3://mf-nwp-models/README.txt') |
| 2120 | assert fs.region == 'eu-west-1' |
| 2121 | f = fs.open_input_stream(path) |
| 2122 | f.read(50) |
| 2123 | |
| 2124 | finalize_s3() |
| 2125 | |
| 2126 | with pytest.raises(ValueError, match="S3 .* finalized"): |
| 2127 | f.read(50) |
| 2128 | with pytest.raises(ValueError, match="S3 .* finalized"): |
| 2129 | fs.open_input_stream(path) |
| 2130 | with pytest.raises(ValueError, match="S3 .* finalized"): |
| 2131 | S3FileSystem(anonymous=True) |
| 2132 | with pytest.raises(ValueError, match="S3 .* finalized"): |
| 2133 | FileSystem.from_uri('s3://mf-nwp-models/README.txt') |
| 2134 | """ |
| 2135 | subprocess.check_call([sys.executable, "-c", code]) |
| 2136 | |
| 2137 | |
| 2138 | @pytest.mark.s3 |
nothing calls this directly
no outgoing calls
no test coverage detected