[Python-Dev] We now have C code coverage!

Brett Cannon brett at python.org
Fri Jun 29 09:25:07 EDT 2018


On Thu, Jun 28, 2018, 21:28 Terry Reedy, <tjreedy at udel.edu> wrote:

> On 6/24/2018 5:03 AM, Ammar Askar wrote:
> >> Is it possible, given that we are not paying for those reports, to
> >> customize the 'exclude_lines' definitions?
> >
> > Do you want to exclude python code or C code?
>
> Python code.
>
> > For Python code, coverage.py also has some comments you can
> > put down to exclude lines:
> > http://coverage.readthedocs.io/en/coverage-4.2/excluding.html
>
> Yes, by default, one can use '# pragma: no cover' and if one uses the
> --branch flag, '# pragma: no branch'.  For more 'advanced exclusion',
> one can use the following, normally in .coveragerc.
> [report]
> exclude_lines = ...
> "This is useful if you have often-used constructs to exclude that can be
> matched with a regex. You can exclude them all at once without littering
> your code with exclusion pragmas."
>
> For IDLE's test suite, I use a customized .coveragerc.  I strongly
> prefer to not abandon that and litter the code with # pragmas.
>
> In order to make sense of the coverage report and have it be truthful,
> one needs to know what options are being used.
> Is the --branch flag set?
> Is .coveragerc or some other configuration file in use?
> If so, what is the content?
> Do we have any control over the use and content of exclusion settings?
>

Everything is either covered by the Travis or codecov configuration files
which are both checked into the cpython repo. (I'm on vacation or else I
would provide links to the files themselves.)



> --
> Terry Jan Reedy
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/brett%40python.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180629/8eaa5435/attachment.html>


More information about the Python-Dev mailing list