-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-38136: Updates await_count and call_count to be different things #16192
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
Conversation
Does this mean we have to revert the doc updated added in #15761 ? |
@tirkarthi yes, I can actually just remove that doc change with this PR. |
@@ -2017,7 +2018,7 @@ def trace(frame, event, arg): # pragma: no cover | |||
) | |||
|
|||
mocks = [ | |||
Mock, MagicMock, NonCallableMock, NonCallableMagicMock | |||
Mock, MagicMock, NonCallableMock, NonCallableMagicMock, AsyncMock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been thinking to add this. Thanks for doing it. It also needs to be added for EventMock
in the other PR just to make sure there is no regression.
When you're done making the requested changes, leave the comment: |
Thanks @lisroach for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, @lisroach, I could not cleanly backport this to |
…hings (pythonGH-16192). (cherry picked from commit ef04851) Co-authored-by: Lisa Roach <[email protected]>
GH-16431 is a backport of this pull request to the 3.8 branch. |
After a lot of discussion we have decided that "calls" and "awaits" should be counted as two different things.
To accomplish this I separated the call counting from the actual execution of the call, that way they are counted at two different times. For synchronous calls the increment and execute calls happen one immediately after another, but for asynchronous calls the increment count for call count happens first, and then only after
await
is called does the call execute and increment the await counters.https://bugs.python.org/issue38136