我正在尝试在我的公共travis repo上设置codecov,但到目前为止还无法成功生成报告并将其上载到编解码器.io. 我似乎在终端收到了一个错误的报告,说我的代码有0%被覆盖了,并发出警告。在
据我所知,我的。特拉维斯·伊梅尔和shell脚本完全符合pytest cov和codecov文档中指定的约定。在
包含完整日志的travis终端在这里:https://www.travis-ci.com/jmaggio14/imagepypelines/jobs/163802897#L681
我的回购可以在这里找到:https://github.com/jmaggio14/imagepypelines/tree/89a6bbc2fadc94a51570d80be356941df1a87a87
我的(简称)。特拉维斯·伊梅尔文件如下:
sudo: false
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
install:
# I removed some other lines for readability here
- pip install codecov pytest-cov hypothesis
script:
# running tests and code coverage report
- py.test --cov=imagepypelines tests/
after_success:
- codecov
最后我收到了以下警告和一条消息:我的测试覆盖了0%的代码
^{pr2}$
我在本地运行测试时重现了这个问题,发现coverage需要
tests
文件夹包含一个__init__.py
才能收集任何数据。在我将
__init__.py
添加到tests
文件夹中,然后coverage按预期收集了数据。在{a1}
相关问题 更多 >
编程相关推荐