coverage.py: exclude files

后端 未结 3 1035
遥遥无期
遥遥无期 2021-02-02 06:50

How do I exclude entire files from coverage.py reports?

According to the documentation you can exclude code by matching lines. I want to exclude entire files, so that th

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-02 07:31

    Omitting some files worked for me using coverage API. Well it is the same kind what Ned suggested.

    Here it is how I did it:

    cov = coverage.coverage(omit='/usr/lib/python2.6/site-packages/*')

提交回复
热议问题