Image a situation where you have a BASE_CLASS
. Several class inherits from that class: CHILD_A
, CHILD_B
, CHILD_C
.
Now let us write unit tests, but ONLY for CHILD_A
, CHILD_B
, CHILD_C
. I would suspect, that the coverage for BASE_CLASS
is 0%. Unfortunately, nose
takes cumulative coverage, which is not what I want. I tried using the ---cover-erase
flag while executing the tests, but that doesn't help.
My question is: How can I force nose
not to use cumulative coverage? I need this to know how good is the unit test for BASE_CLASS
.
Your tests are running the code in
BASE_CLASS
. Python doesn't just know what in the base class when creating sub class instances. It has to go to the base class and look at the code there.If you want to see how good your coverage for that particular base class you can run the test case/method specific to that class. From the docs: