# in .coveragerc
[report]
exclude_lines =
@deco
pragma: no cover
从文档中:
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.
在.coveragerc文件中,可以指定将排除行的正则表达式(如Advanced exclusion中所述)
如果正则表达式与引入代码子句的行匹配,则整个子句被排除。排除装饰器将排除整个函数
这应该适合您:
从文档中:
相关问题 更多 >
编程相关推荐