python coverage如何排除除某些文件以外的文件夹?

2024-06-11 13:21:41 发布

您现在位置:Python中文网/ 问答频道 /正文

.coveragerc文件中includeomit的顺序是“先包含,然后排除”:

If both include and omit are specified, first the set of files is reduced to only those that match the include patterns, then any files that match the omit pattern are removed from the set.

https://coverage.readthedocs.io/en/v4.5.x/source.html#execution

但我需要排除文件夹与许多文件,除了一些我想覆盖

当然,我可以扩展排除来显式列出所有文件,但这看起来很愚蠢,很难维护

是否可以在配置文件中指定“省略,除了…”


Tags: and文件theifthatinclude顺序match