As far as I can tell, it isn't posible to exclude multiple lines with exclude_lines. If I am reading the code correctly, it uses the lines_matching
function, which checks the regexes line-by-line
My use-case is I want to exclude lines like
except ValueError: assume(False)
where assume
is from hypothesis. Simply excluding assume(False)
doesn't work because it doesn't exclude the except
. I don't want to exclude other except ValueError
blocks in the codebase. I know I can rewrite this as except ValueError: assume(False)
on a single line, but I would prefer not to as I don't like code that does that.
What I would like to do is to write something like
[report] exclude_lines = except ValueError:\n *assume\(False\)
Or if that can't work
[report] exclude_lines = except ValueError:(?=\n *assume\(False\))
Neither of these work presently. As far as I can tell this can only be excluded by manually putting # pragma: no cover
on each instance.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4