当我跑步时
coverage run -m pytest tests/
在终端中coverage report
我有以下错误:
No source for code: '/private/var/.../_remote_module_non_scriptable.py'.
这似乎已经解决了一个类似的问题,但是我不了解solution。
coverage xml -i
<tmpdir>/_remote_module_non_scriptable.py
是由Pytorch生成的。
Solution:添加到
pyproject.toml
[tool.coverage.run]
omit = [
# omit pytorch-generated files in /tmp
"/tmp/*",
]