bpo-38136: Updates await_count and call_count to be different things#16192
bpo-38136: Updates await_count and call_count to be different things#16192lisroach merged 8 commits intopython:masterfrom
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. |
|
|
||
| mocks = [ | ||
| Mock, MagicMock, NonCallableMock, NonCallableMagicMock | ||
| Mock, MagicMock, NonCallableMock, NonCallableMagicMock, AsyncMock |
There was a problem hiding this comment.
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
awaitis called does the call execute and increment the await counters.https://bugs.python.org/issue38136