【问题标题】:python coverage error during html report (NoSource: No source for code:)html 报告期间的 python 覆盖错误(NoSource: No source for code:)
【发布时间】:2020-01-07 02:19:43
【问题描述】:

在报告 html 覆盖率时遇到以下错误。

myrepo>coverage report html
html   NoSource: No source for code: 'C:\Users\usr\AppData\Local\Programs\Python\Python37-32\Lib\html': [Errno 13] Permission denied: 'C:\\Users\\usr\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib\\html'
Name    Stmts   Miss  Cover
---------------------------
No data to report.

但是,该目录存在,我对此有权限:

myrepo>ls -la C:\Users\usr\AppData\Local\Programs\Python\Python37-32\Lib\html
total 172
drwxr-xr-x 1 usr 197121     0 Nov 26  2018 .
drwxr-xr-x 1 usr 197121     0 Nov 26  2018 ..
-rw-r--r-- 1 usr 197121  4888 Oct 20  2018 __init__.py
drwxr-xr-x 1 usr 197121     0 Nov 26  2018 __pycache__
-rw-r--r-- 1 usr 197121 77824 Oct 20  2018 entities.py
-rw-r--r-- 1 usr 197121 18191 Oct 20  2018 parser.py

注意,我可以在终端打印覆盖率报告:

myrepo>coverage report
Name                               Stmts   Miss  Cover
------------------------------------------------------
tests\PexpectTestCase.py              46     18    61%
tests\__init__.py                      2      0   100%
tests\test_command_list_split.py      18      1    94%
tests\test_constructor.py             18      1    94%
tests\test_delay.py                   25      0   100%
tests\test_destructor.py              56      2    96%
wexpect.py                          1401    819    42%
------------------------------------------------------
TOTAL                               1566    841    46%

如何生成 html 报告?

【问题讨论】:

    标签: python windows windows-10 python-unittest coverage.py


    【解决方案1】:

    您使用coverage html 生成HTML 报告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-30
      • 1970-01-01
      • 2020-05-05
      • 2017-03-29
      • 1970-01-01
      相关资源
      最近更新 更多