Line break within function declaration disables exclusion of the function body · Issue #684 · nedbat/coveragepy (original) (raw)

.coveragerc file:

[report]
exclude_lines =
    long_function_name.+

Code:

def long_function_name(some_long_argument, another_long_argument): pass

This setup works and results in the following report:

Name      Stmts   Miss  Cover   Missing
---------------------------------------
file.py       0      0   100%

However, if a line break is introduced between arguments and the second line gets indented in compliance to the PEP-8:

def long_function_name(some_long_argument, another_long_argument): pass

Then the body isn't excluded anymore:

Name      Stmts   Miss  Cover   Missing
---------------------------------------
file.py       1      1     0%   4

I'm not really sure if this is a bug, but I haven't found a way to bypass this behaviour - I would like the whole function excluded, regardless of the formatting of function arguments. Is this possible?