Skip to content

Line break within function declaration disables exclusion of the function body #684

@fuine

Description

@fuine

.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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions