4 ms·
Very nice work. > I don't know who's fault this ultimately is, but it does illustrate a possible danger of mock testing when messing with the internals of othe
by nemetroid 7y ago
Very nice work.
> I don't know who's fault this ultimately is, but it does illustrate a possible danger of mock testing when messing with the internals of other libraries.
It doesn't look like there's any way that _TemporaryFileWrapper() could throw an OSError. I'd consider that mock a bug.
- ehsankia 7y agoIt's also why you keep your try/catch blocks as small as possible. In this case, if the return was outside, which it probably should've been, then the error would've bubbled up instead of causing I/O failure.