【发布时间】:2018-12-08 05:24:03
【问题描述】:
我正在尝试在我的公共 travis 存储库上设置 codecov,但目前无法成功生成报告并将其上传到 codecov.io。我似乎在终端中收到了一个错误报告,说我的代码的 0% 已被覆盖并发出警告。
据我所知,我的 .travis.yml 和 shell 脚本完全符合 pytest-cov 和 codecov 文档中指定的约定。
包含完整日志的我的 travis 终端在这里:https://www.travis-ci.com/jmaggio14/imagepypelines/jobs/163802897#L681
我的仓库可以在这里找到:https://github.com/jmaggio14/imagepypelines/tree/89a6bbc2fadc94a51570d80be356941df1a87a87
我的(缩短的).travis.yml 文件如下:
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% 已被我的测试覆盖
Coverage.py warning: No data was collected. (no-data-collected)
【问题讨论】:
-
我假设该命令适用于您的本地机器?您也可以尝试使用
pytest而不是py.test -
不,无论机器如何,我都会得到相同的结果。刚刚尝试
pytest并得到了相同的结果:/
标签: python travis-ci pytest codecov pytest-cov