GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — bpo-17013: Extend Mock.called to allow waiting for calls by Kentzo · Pull Request #17133 · python/cpython Conversation
|
|
Probably one method that the object should definitely have is |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
54b7b06 to
c740cb8
Compare
New methods allow tests to wait for calls executing in other threads.
|
Thanks @Kentzo for putting this through. From conversations with @voidspace, @lisroach, @tirkarthi and in the issue tracker it seems that people wanted to go with having a different mock just for this use case, rather than trying to fold it into the existing one. Similar to what was done with AsyncMock. Happy to re-evaluate it, but I guess that should be a conversation in the issue tracker. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing this PR for now, as it looks like @mariocj89 will be putting in another PR to take over from this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cjw296 Hmm, where was that discussion? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
https://bugs.python.org/issue17013#msg352211 Looks like @mariocj89 's PR actually predates this one, I don't have a strong opinion on either, so happy to re-open this PR if you, @mariocj89, @tirkarthi, @voidspace and @lisroach want to discuss which PR to take forward. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @Kentzo, this was initially discussed in https://bugs.python.org/issue17013#msg352211 and offlne in the core dev sprints with @voidspace, @lisroach and @tirkarthi when we put forward the other PR. @voidspace preferred to go down the path of having specialized mocks rather than having a mock have all the functionality. Similar to the asyncmock. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
At some point I was asked to move the discussion to bugs.python. For the benefit of the future developers I believe it makes sense to point out the benefits of the new "class approach" there as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Absolutely, that's why I suggested that. The issue lays on the availability of committer time though. It might be a busy time right now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Added implementation of the mock.method_1.called.wait_for_call(call(1, a=1), timeout=0.01) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Kentzo - it's unclear where you've added this? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I guess PR is not updated because it's closed. The corresponding branch in my repo got updated. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Any chance for this PR to get reviewed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Doesn't look like I can re-open this PR, so please submit a new one if you want anything reviewed. Please comment here with a link to the new one. @mariocj89 - where did you get to with your approach? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
There is an open PR that was reviewed but never re-reviewed after proposed changes here: #16094 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Just noticed that I put wrong link above 🤦🏻♂️, fixed the comment. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.