Last Updated: February 25, 2016
·
1.81K
· jarus

Testing multiple flask version on Travis-CI

As a Flask extension developer you will normaly want to test your extension against a list of Flask versions. On Travis-CI it's very simple and amazingly powerful.

The following .travis.yml file shows you how I test my Flask extensions.

language: python
python:
  - "2.6"
  - "2.7"
env:
  - FLASK=dev
  - FLASK=0.9
  - FLASK=0.8
  - FLASK=0.7
  - FLASK=0.6
  - FLASK=0.5
install:
  - pip install flask==$FLASK --use-mirrors
  - pip install -e . --use-mirrors
script:
  - python setup.py test

The trick is to define the Flask versions as env variables and install the Flask package befor the other packages and take the specify version from the env variable.