:模式:sphinx.ext.coverage–收集文档覆盖率统计

这个扩展还有一个生成器:class:CoverageBuilder

class sphinx.ext.coverage.CoverageBuilder[源代码]

To use this builder, activate the coverage extension in your configuration file and give -M coverage on the command line.

待处理

撰写本章节

可以使用多个配置值来指定生成器应检查的内容:

coverage_ignore_modules
coverage_ignore_functions
coverage_ignore_classes
coverage_ignore_pyobjects

“Python正则表达式”列表。

如果这些正则表达式中的任何一个与Python对象的完整导入路径的任何部分匹配,那么该Python对象将从文档覆盖率报告中排除。

Added in version 2.1.

coverage_c_path
coverage_c_regexes
coverage_ignore_c_items
coverage_write_headline

设置为“False”不写标题。

Added in version 1.1.

coverage_skip_undoc_in_source

跳过源文件中没有用docstring记录的对象。``默认情况下为False。

Added in version 1.1.

coverage_show_missing_items

打印标准输出中缺少的对象。``默认情况下为False。

Added in version 3.1.

coverage_statistics_to_report

Print a tabular report of the coverage statistics to the coverage report. True by default.

Example output:

+-----------------------+----------+--------------+
| Module                | Coverage | Undocumented |
+=======================+==========+==============+
| package.foo_module    | 100.00%  | 0            |
+-----------------------+----------+--------------+
| package.bar_module    | 83.33%   | 1            |
+-----------------------+----------+--------------+

Added in version 7.2.

coverage_statistics_to_stdout

Print a tabular report of the coverage statistics to standard output. False by default.

Example output:

+-----------------------+----------+--------------+
| Module                | Coverage | Undocumented |
+=======================+==========+==============+
| package.foo_module    | 100.00%  | 0            |
+-----------------------+----------+--------------+
| package.bar_module    | 83.33%   | 1            |
+-----------------------+----------+--------------+

Added in version 7.2.