2013-02-05 62 views

回答

6

這是一個示例.travis.yaml Django單元測試與MySQL集成。

language: python 
python: 
    # - "2.6" 
    - "2.7" 
services: mysql 
env: 
    # - DJANGO=1.2.7 
    # - DJANGO=1.3.1 
    - DJANGO=1.4.3 DJANGO_SETTINGS_MODULE="mysite.travis_settings" 
install: 
    - pip install -q Django==$DJANGO --use-mirrors 
    - pip install pep8 --use-mirrors 
    - pip install mysql-python --use-mirrors 
    # - pip install https://github.com/dcramer/pyflakes/tarball/master 
    # - pip install -q -e . --use-mirrors 
before_script: 
# - "pep8 --exclude=migrations --ignore=E501,E225 src" 
# - pyflakes -x W src 
    - mysql -e 'create database mysite_db;' 
    - python manage.py syncdb --noinput 
script: 
    - python manage.py test