-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
aiohttp.ClientSession.get
context manager gives AttributeError: __aexit__
#3347
Comments
GitMate.io thinks the contributor most likely able to help you is @asvetlov. Possibly related issues are #2154 (Question: Do I need to use a context manager with all ClientSession HTTP methods?), #548 (Implement timeout context manager), #2362 (Drop sync context manager supports), #2867 (aiohttp.ClientSession reconnect ), and #3119 (Using client sessions without a context manager). |
I'm sorry but I cannot figure out how the problem can appear. |
I'm trying to isolate it -- problem still happens if timeout is left as default in ClientTimeout... Trying to make it reproducible is not easy as it tends to work as expected when I reduce the calling code around it. I'm trying to reason about it. If |
|
Yes! This is a mocked connection... I am mocking
|
I think I found the problem @asvetlov -- my mock is behaving badly... so unlikely an issue with the library... You put me on the right thrack, thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
It appears as if the context manager on
aiohttp.ClientSession.get
is failing for some reason.It works in an isolated test, but when i run it here I get this. I tried the
get()
without headers too to see if that was upsetting it -- no difference, yet the session looks okay. Timeout is set to 60 sec and it fails well before that.Expected behaviour
I expect
__aexit__()
to be there and theasync with
to work as normal.Actual behaviour
pytest output:
Log:
Steps to reproduce
As illustrated above.
Your environment
MacOS mojave
aiohttp==3.4.4
Python 3.7.0
The text was updated successfully, but these errors were encountered: