[python-committers] Codecov and PR
Ethan Furman
ethan at stoneleaf.us
Wed Apr 26 11:23:58 EDT 2017
On 04/25/2017 11:05 PM, Victor Stinner wrote:
> On 04/25/2017 10:15 PM, INADA Naoki wrote:
>> `self.initfp()` is very unlikely raise exceptions. But MemoryError,
>> KeyboardInterrupt or
>> other rare exceptions may be happen.
>
> unittest.mock helps a lot to test such corner case: mock initfp() with a MemoryError side effect, maybe also close () to
> check that the method was called... The new problem is that on 3 instructions, 2 are mocked... The test now checks the
> test itself or the real application?
That application -- specifically, the except clause of the application. There should be other tests for the non-except
clause portions.
--
~Ethan~
More information about the python-committers
mailing list