Fix assertions regarding magic methods function body that was not executed#14154
Conversation
|
@lisroach @mariocj89 Would be helpful to have a review of this change . This is a test only change and doesn't require a NEWS entry or an issue. I have removed the assertions as per PR description and also removed the constructor since it's not needed. |
|
Sorry, I am not sure why the test is wrong, are you saying that the original code that is being passed to the mock is not being called? 😕 |
Yes, when an object is presented as spec to Line 1957 in 0a28f8d So in these tests |
lisroach
left a comment
There was a problem hiding this comment.
You are right, thanks for catching this!
|
Closed and reopened to try to re-trigger Azure |
|
@lisroach This PR seems to have stalled. Are you planning to merge it? |
|
Yes sorry for the delay, I've gotten really busy but plan to loop back
around to this during the sprint at the latest.
…On Wed, Aug 28, 2019 at 10:50 PM Ned Deily ***@***.***> wrote:
@lisroach <https://github.com/lisroach> This PR seems to have stalled.
Are you planning to merge it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14154?email_source=notifications&email_token=ACUVNKGILVOK3WTM2ULJ7ITQG5PTNA5CNFSM4HYVLVJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5NKLMI#issuecomment-526034353>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACUVNKGDCIMDSBU2XJDDA5LQG5PTNANCNFSM4HYVLVJA>
.
|
|
Thanks Lisa :) |
|
|
Buildbot looks like a False positive. |
The context manager object supplied to
MagicMockhas the magic methods__aenter__and__aexit__called with mock call registered but the actual function body was not executed. SinceMagicMockis always True the attributes entered and exited returned aMagicMockthat asserted to True in the test.