@@ -261,3 +261,45 @@ markers = [
261
261
" git: VCS: git" ,
262
262
" search: tests for 'pip search'" ,
263
263
]
264
+
265
+ # #####################################################################################
266
+ # coverage
267
+ #
268
+
269
+ [tool .coverage .run ]
270
+ branch = true
271
+ # Do not gather coverage for vendored libraries.
272
+ omit = " */_vendor/*"
273
+ # Centralized absolute file prefix for coverage files.
274
+ data_file = " ${COVERAGE_OUTPUT_DIR}/.coverage"
275
+ # By default, each covered process will try to truncate and then write to
276
+ # `data_file`, but with `parallel`, they will write to separate files suffixed
277
+ # with hostname, pid, and a timestamp.
278
+ parallel = true
279
+ # If not set, then at the termination of each worker (when using pytest-xdist),
280
+ # the following is traced: "Coverage.py warning: Module pip was previously
281
+ # imported, but not measured (module-not-measured)"
282
+ disable_warnings = " module-not-measured"
283
+
284
+ [tool .coverage .paths ]
285
+ # We intentionally use "source0" here because pytest-cov unconditionally sets
286
+ # "source" after loading the config.
287
+ source0 = [
288
+ # The primary source code path which other paths will be combined into.
289
+ " src/pip/" ,
290
+ # Unit test source directory e.g.
291
+ # `.tox/coverage-py3/lib/pythonX.Y/site-packages/pip/...`
292
+ " */site-packages/pip/" ,
293
+ # Functional test virtual environment directories, which look like
294
+ # `tmpdir/pip0/pip/src/pip/...`
295
+ " */pip/src/pip/" ,
296
+ ]
297
+
298
+ [tool .coverage .report ]
299
+ exclude_lines = [
300
+ # We must re-state the default because the `exclude_lines` option overrides
301
+ # it.
302
+ " pragma: no cover" ,
303
+ # This excludes typing-specific code, which will be validated by mypy anyway.
304
+ " if TYPE_CHECKING" ,
305
+ ]
0 commit comments