Author mariocj89
Recipients cjw296, lisroach, mariocj89, michael.foord, stanislavlevin, xtreak
Date 2020-10-06.11:53:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601985226.64.0.689416327232.issue41954@roundup.psfhosted.org>
In-reply-to
Content
Oh, well spotted. We could add some guards around the code in mock to still work when key stdlib functionality is mocked out, but this might make the mock code quite messy. Specially as we will have to make sure that not only the function we call are safe to call (which is easy by just doing import from), but that all dependencies of those function are also safe to call.

I'd instead suggest for users to patch in the module where they are using the function instead.

I think that once any part of the stdlib is patched by mock, there are no guarantees that anything will work unless the patch provides a functioning implmentation.
History
Date User Action Args
2020-10-06 11:53:46mariocj89setrecipients: + mariocj89, cjw296, michael.foord, lisroach, xtreak, stanislavlevin
2020-10-06 11:53:46mariocj89setmessageid: <1601985226.64.0.689416327232.issue41954@roundup.psfhosted.org>
2020-10-06 11:53:46mariocj89linkissue41954 messages
2020-10-06 11:53:46mariocj89create