[Twisted-Python] Coverage exceptions

Adi Roiban adi at roiban.ro
Thu Jun 30 04:43:17 MDT 2016


Hi,

Recently we have introduced a hard check of 100% coverage for all changes.
This is done via coverage + codecov + github protected branches.

Now, if your patch is not 100% covered github will not let you merge it.

See for example this change:
https://github.com/twisted/twisted/pull/261/files#diff-0fea8a8ca713deb7ea6a10053273319aR2360

The errback is there to help with test failures ... but the test should
never fail, so that errback is never called... and that line is not covered.

How should we proceed with these changes?

Maybe this is not the best example and that code could be refactored... but
I think that the topic of ignoring missing coverage is still valid.

I suggest to introduce `  # pragma: no cover`

and update the coverage config with

[report]
exclude_lines =
    pragma: no cover

-----------

What do you think?

Thanks!
-- 
Adi Roiban
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20160630/ad3526b2/attachment.html>


More information about the Twisted-Python mailing list