我有一份 travis 工作,如下所示:
jobs:
include:
- stage: "Unit tests"
language: python
python:
- "3.6"
- "3.7"
install:
- pip install -r requirements.txt
script:
- python -m unittest test.client
我希望这个单元测试运行两个作业,一个针对 python 3.6,一个针对 3.7,但它始终只针对列出的第一个版本运行。我在这里错过了什么吗?我按照 the docs 的指南进行操作
谢谢
最佳答案
Python 版本不是在作业中定义的,而是在根级别定义的。
python:
- "3.6"
- "3.7"
jobs:
...
我发现这一点是因为 travis 最近引入了构建配置验证。它可以在您的构建 -> 查看配置 -> 构建配置验证
下找到关于python - Travis 没有启动多个 python 版本的作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58857860/