如何在
Travis-CI以内测试
Tox的不同Python版本?
我有一个tox.ini:
- [tox]
- envlist = py{27,33,34,35}
- recreate = True
- [testenv]
- basepython =
- py27: python2.7
- py33: python3.3
- py34: python3.4
- py35: python3.5
- deps =
- -r{toxinidir}/pip-requirements.txt
- -r{toxinidir}/pip-requirements-test.txt
- commands = py.test
它运行我的Python单元测试在几个Python版本和工作完美.
我想在Travis-CI中设置一个构建,以便在将更改推送到Github时自动运行,所以我有一个.travis.yml:
- language: python
- python:
- - "2.7"
- - "3.3"
- - "3.4"
- - "3.5"
- install:
- - pip install tox
- script:
- - tox
这在技术上似乎是有效的,但是从Python的每个版本到Python的每一个版本,它都是冗余的.所以需要5分钟的构建需要45分钟.
我尝试从我的yaml文件中删除python列表,所以Travis只会运行一个Python实例,但是导致我的Python3.5测试失败,因为3.5解释器找不到.显然,这是一个known limitation,因为Travis-CI将不会安装Python3.5,除非您在配置中指定了确切的版本,但它并没有为其他版本.
有没有办法解决这个问题?