@@ -104,7 +104,7 @@ all of them by adding a regex to the exclusion list:
104
104
[tool.coverage.report]
105
105
exclude_also = [
106
106
"def __repr__",
107
- ]
107
+ ]
108
108
""",
109
109
)
110
110
.. ]]]
@@ -124,7 +124,7 @@ all of them by adding a regex to the exclusion list:
124
124
[tool.coverage.report]
125
125
exclude_also = [
126
126
"def __repr__",
127
- ]
127
+ ]
128
128
129
129
.. code-tab :: ini
130
130
:caption: setup.cfg or tox.ini
@@ -133,7 +133,7 @@ all of them by adding a regex to the exclusion list:
133
133
exclude_also =
134
134
def __repr__
135
135
136
- .. [[[end]]] (checksum: e3194120285bcbac38a92b109edaa20c )
136
+ .. [[[end]]] (checksum: f3e70ebf128fbef4087efe75dcfadcb8 )
137
137
138
138
For example, here's a list of exclusions I've used:
139
139
@@ -156,17 +156,17 @@ For example, here's a list of exclusions I've used:
156
156
toml=r"""
157
157
[tool.coverage.report]
158
158
exclude_also = [
159
- " def __repr__" ,
160
- " if self.debug:" ,
161
- " if settings.DEBUG" ,
162
- " raise AssertionError" ,
163
- " raise NotImplementedError" ,
164
- " if 0:" ,
165
- " if __name__ == .__main__.:" ,
166
- " if TYPE_CHECKING:" ,
167
- " class .*\\ bProtocol\\):" ,
168
- " @(abc\\ .)?abstractmethod" ,
169
- ]
159
+ ' def __repr__' ,
160
+ ' if self.debug:' ,
161
+ ' if settings.DEBUG' ,
162
+ ' raise AssertionError' ,
163
+ ' raise NotImplementedError' ,
164
+ ' if 0:' ,
165
+ ' if __name__ == .__main__.:' ,
166
+ ' if TYPE_CHECKING:' ,
167
+ ' class .*\bProtocol\):' ,
168
+ ' @(abc\.)?abstractmethod' ,
169
+ ]
170
170
""",
171
171
)
172
172
.. ]]]
@@ -194,17 +194,17 @@ For example, here's a list of exclusions I've used:
194
194
195
195
[tool.coverage.report]
196
196
exclude_also = [
197
- " def __repr__" ,
198
- " if self.debug:" ,
199
- " if settings.DEBUG" ,
200
- " raise AssertionError" ,
201
- " raise NotImplementedError" ,
202
- " if 0:" ,
203
- " if __name__ == .__main__.:" ,
204
- " if TYPE_CHECKING:" ,
205
- " class .*\\ bProtocol\\ ):" ,
206
- " @(abc\\ .)?abstractmethod" ,
207
- ]
197
+ ' def __repr__' ,
198
+ ' if self.debug:' ,
199
+ ' if settings.DEBUG' ,
200
+ ' raise AssertionError' ,
201
+ ' raise NotImplementedError' ,
202
+ ' if 0:' ,
203
+ ' if __name__ == .__main__.:' ,
204
+ ' if TYPE_CHECKING:' ,
205
+ ' class .*\b Protocol\) :' ,
206
+ ' @(abc\. )?abstractmethod' ,
207
+ ]
208
208
209
209
.. code-tab :: ini
210
210
:caption: setup.cfg or tox.ini
@@ -222,7 +222,7 @@ For example, here's a list of exclusions I've used:
222
222
class .*\b Protocol\) :
223
223
@(abc\. )?abstractmethod
224
224
225
- .. [[[end]]] (checksum: 91f09828a1e6d0e92543e14a8ea3ba39 )
225
+ .. [[[end]]] (checksum: 650b209edd27112381b5f0a8d2ee0c45 )
226
226
227
227
The :ref: `config_report_exclude_also ` option adds regexes to the built-in
228
228
default list so that you can add your own exclusions. The older
@@ -270,12 +270,12 @@ Here are some examples:
270
270
[tool.coverage.report]
271
271
exclude_also = [
272
272
# 1. Exclude an except clause of a specific form:
273
- " except ValueError:\\n\\ s*assume\\ (False\\)" ,
273
+ ' except ValueError:\n\ s*assume\(False\)' ,
274
274
# 2. Comments to turn coverage on and off:
275
- " no cover: start(?s:.)*?no cover: stop" ,
275
+ ' no cover: start(?s:.)*?no cover: stop' ,
276
276
# 3. A pragma comment that excludes an entire file:
277
- "\\ A(?s:.*# pragma: exclude file.*)\\Z" ,
278
- ]
277
+ '\ A(?s:.*# pragma: exclude file.*)\Z' ,
278
+ ]
279
279
""",
280
280
)
281
281
.. ]]]
@@ -300,12 +300,12 @@ Here are some examples:
300
300
[tool.coverage.report]
301
301
exclude_also = [
302
302
# 1. Exclude an except clause of a specific form:
303
- " except ValueError:\\ n \\ s*assume\\ (False\\ )" ,
303
+ ' except ValueError:\n\ s *assume\( False\) ' ,
304
304
# 2. Comments to turn coverage on and off:
305
- " no cover: start(?s:.)*?no cover: stop" ,
305
+ ' no cover: start(?s:.)*?no cover: stop' ,
306
306
# 3. A pragma comment that excludes an entire file:
307
- " \\ A(?s:.*# pragma: exclude file.*)\\ Z" ,
308
- ]
307
+ ' \ A (?s:.*# pragma: exclude file.*)\Z ' ,
308
+ ]
309
309
310
310
.. code-tab :: ini
311
311
:caption: setup.cfg or tox.ini
@@ -319,7 +319,7 @@ Here are some examples:
319
319
; 3. A pragma comment that excludes an entire file:
320
320
\A (?s:.*# pragma: exclude file.*)\Z
321
321
322
- .. [[[end]]] (checksum: ee3ef14b5a5d73f987b924df623a4927 )
322
+ .. [[[end]]] (checksum: c46e819ad9a1d3a8e37037a89d28cfde )
323
323
324
324
The first regex matches a specific except line followed by a specific function
325
325
call. Both lines must be present for the exclusion to take effect. Note that
0 commit comments