Skip to content

Commit

Permalink
Merge pull request #377 from martindurant/small_close
Browse files Browse the repository at this point in the history
slightly simplify close test
  • Loading branch information
martindurant authored Oct 7, 2020
2 parents 1a6eb06 + 6361244 commit f94478e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions s3fs/tests/test_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1661,20 +1661,20 @@ async def _():
loop = asyncio.get_event_loop()
s3 = S3FileSystem(anon=False,
asynchronous=True,
loop=loop,
client_kwargs={"region_name": "eu-west-1"})
loop=loop)
await s3._connect()

fn = test_bucket_name + "/afile"

async def async_wrapper():
coros = [asyncio.ensure_future(s3._get_file(fn, '/nonexistent/a/b/c'), loop=loop) for _ in range(3)]
coros = [asyncio.ensure_future(s3._get_file(fn, '/nonexistent/a/b/c'), loop=loop)
for _ in range(3)]
completed, pending = await asyncio.wait(coros)
for future in completed:
with pytest.raises(OSError):
future.result()

await asyncio.gather(*[async_wrapper() for __ in range(5)])
await asyncio.gather(*[async_wrapper() for __ in range(2)])

await s3._s3.close()

Expand Down

0 comments on commit f94478e

Please sign in to comment.