Mario Corchero <marioc...@gmail.com> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41954> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com