[TIP] Coverage.py 4.1b2: re-written branch measurement

Ned Batchelder ned at nedbatchelder.com
Mon Jan 25 03:11:36 PST 2016


On 1/24/16 9:49 PM, Barry Warsaw wrote:
> On Jan 23, 2016, at 08:08 PM, Ned Batchelder wrote:
>
>> Try it, let me know what you think: https://pypi.python.org/pypi/coverage/4.1b2
> I haven't done a detailed analysis of the output, but it's definitely
> different.  I ran both the stable and pre-release versions over the Mailman 3
> core's git master head.  Here are the totals:
>
> Name                                                                               Stmts   Miss Branch BrPart  Cover   Missing
> ------------------------------------------------------------------------------------------------------------------------------
> TOTAL (stable)                                                                     14386   1127   4377    463    90%
> TOTAL (pre-release)                                                                12456    954   3350    309    91%
>
> So I find it interesting that there are now fewer total number of statements,
> with correspondingly lower totals on the other values.  Except total
> coverage.  Yay!  I get to claim a little boost with no extra work. :)
>
> Is there an easy way to compare the different results, considering it's
> reporting on almost 300 files?
It might be a bit rough, but you can get a pretty dump of the raw 
collected data:

     $ python -m coverage.data .the_coverage_data_file
     --- .the_coverage_data_file ------------------------------
     {
         "arcs": {
             "/Users/ned/foo/goo.py": [
                 [8, -1],
                 [-1, 1],
                 [1, 3],
                 [5, 7],
                 [7, 8],
                 [3, 5]
             ]
         }
     }

If you do that for your before and after data files, the diff might be 
minimally navigable.  The pairs are from-to arcs in the code. Negative 
numbers mean code object entrances (if the first number) or exits (if 
the second).  Code objects can be modules, classes, or functions.

--Ned.
>
> Cheers,
> -Barry
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20160125/32a5613b/attachment.html>


More information about the testing-in-python mailing list