Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests cleanup #75

Merged
merged 7 commits into from
Nov 19, 2016
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions aiobotocore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ def __aexit__(self, exc_type, exc_val, exc_tb):
exc_val, exc_tb)

def close(self):
"""Close all http connections"""
# ClientSession.close() from aiohttp returns asyncio.Future here so
# this method could be used with yield from/await
"""Close all http connections. This is coroutine, and should be
awaited. Method will be coroutine (instead returning Future) once
aiohttp does that.
"""
return self._endpoint._aio_session.close()


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages


install_requires = ['botocore>=1.4.0, <=1.4.73', 'aiohttp>=0.21.2']
install_requires = ['botocore>=1.4.0, <=1.4.28', 'aiohttp>=1.1.0']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jettify Does aiobotocore actually require aiohttp>=1.1.0? The service in which I would like to aiobotocore is stuck on aiohttp==0.22.5 until aio-libs/aiohttp#1180 is resolved. As far as I can tell there aren't any changes here that strictly require bumping the aiohttp version? Would it be possible to leave this alone? Or at least make it >=0.22.5?


PY_VER = sys.version_info

Expand Down
5 changes: 5 additions & 0 deletions tests/test_basic_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def test_get_object_stream_wrapper(s3_client, create_object, bucket_name):
chunk2 = yield from body.read()
assert chunk1 == b'b'
assert chunk2 == b'ody contents'
response['Body'].close()


@pytest.mark.run_loop
Expand Down Expand Up @@ -204,6 +205,7 @@ def test_unicode_key_put_list(s3_client, bucket_name, create_object):
assert parsed['Contents'][0]['Key'] == key_name
parsed = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name)
data = yield from parsed['Body'].read()
parsed['Body'].close()
assert data == b'foo'


Expand Down Expand Up @@ -255,6 +257,7 @@ def test_copy_with_quoted_char(s3_client, create_object, bucket_name):
# Now verify we can retrieve the copied object.
resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2)
data = yield from resp['Body'].read()
resp['Body'].close()
assert data == b'foo'


Expand All @@ -271,6 +274,7 @@ def test_copy_with_query_string(s3_client, create_object, bucket_name):
# Now verify we can retrieve the copied object.
resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2)
data = yield from resp['Body'].read()
resp['Body'].close()
assert data == b'foo'


Expand All @@ -287,6 +291,7 @@ def test_can_copy_with_dict_form(s3_client, create_object, bucket_name):
# Now verify we can retrieve the copied object.
resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2)
data = yield from resp['Body'].read()
resp['Body'].close()
assert data == b'foo'


Expand Down