diff options
Diffstat (limited to 'doc/excluding.rst')
-rw-r--r-- | doc/excluding.rst | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/doc/excluding.rst b/doc/excluding.rst index 4651e6bb..e9d28f15 100644 --- a/doc/excluding.rst +++ b/doc/excluding.rst @@ -80,14 +80,13 @@ debugging code, and are uninteresting to test themselves. You could exclude all of them by adding a regex to the exclusion list:: [report] - exclude_lines = + exclude_also = def __repr__ For example, here's a list of exclusions I've used:: [report] - exclude_lines = - pragma: no cover + exclude_also = def __repr__ if self.debug: if settings.DEBUG @@ -99,11 +98,10 @@ For example, here's a list of exclusions I've used:: class .*\bProtocol\): @(abc\.)?abstractmethod -Note that when using the ``exclude_lines`` option in a configuration file, you -are taking control of the entire list of regexes, so you need to re-specify the -default "pragma: no cover" match if you still want it to apply. The -``exclude_also`` option can be used instead to preserve the default -exclusions while adding new ones. +The :ref:`config_report_exclude_also` option adds regexes to the built-in +default list so that you can add your own exclusions. The older +:ref:`config_report_exclude_lines` option completely overwrites the list of +regexes. The regexes only have to match part of a line. Be careful not to over-match. A value of ``...`` will match any line with more than three characters in it. |