redDragonzz
redDragonzz

Reputation: 1571

Sample .travis for Django with MySQL tests

Need a .travis sample yaml file for unit testing mysql queries on Django.

Upvotes: 2

Views: 1405

Answers (1)

redDragonzz
redDragonzz

Reputation: 1571

This is a sample .travis.yaml for Django unit testing with MySQL integration.

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

Upvotes: 6

Related Questions