How to run Tox with Travis-CI

前端 未结 4 1493
情话喂你
情话喂你 2021-02-01 03:45

How do you test different Python versions with Tox from within Travis-CI?

I have a tox.ini:

[tox]
envlist = py{27,33,34,35}
recreate = True
         


        
4条回答
  •  伪装坚强ぢ
    2021-02-01 04:37

    For this I would consider using tox-travis. This is a plugin which allows use of Travis CI’s multiple python versions and Tox’s full configurability. To do this you will configure the .travis.yml file to test with Python:

    sudo: false
    language: python
    python:
        - "2.7"
        - "3.4"
    install: pip install tox-travis
    script: tox
    

    This will run the appropriate testenvs, which are any declared env with py27 or py34 as factors of the name by default. Py27 or py34 will be used as fallback if no environments match the given factor.

    Further Reading

提交回复
热议问题