You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Report when excluded lines are executed #619
Originally reported byToshio Kuratomi (Bitbucket: toshio, GitHub: toshio)
I've found that I use coverage's exclude_lines configuration[1]_ to exclude code that I determine is unreachable in the environment under test. For me, this doesn't mean code like repr() which could be called during a test run but things shielded by "if False:" or by "if six.PY3" under Python2[2]_.
I talked to a detractor of this usage of excluding lines from the reports and realized that for my use case it would be helpful if I could have a configuration switch which would make coverage report when code that I've marked for exclusion was executed. If it's executed, then it's obviously not unreachable which means that either my code isn't doing what I thought it was or my listing the code for exclusion from the coverage report should be revisited. (It needs to be a toggle since some people will have different use cases than I do. For instance, the use case in coverage's docs about marking debugging-only code for exclusion would want to toggle this new feature off).
Activity
nedbat commentedon Nov 25, 2017
Duplicate of #251.
nedbat commentedon Nov 25, 2017
Original comment by Toshio Kuratomi (Bitbucket: toshio, GitHub: toshio)
Agreed, #251 describes the same request; jsut with a different justification in the initial comment.