Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 用于Django的Sample.travis和MySQL测试_Python_Django_Travis Ci - Fatal编程技术网

Python 用于Django的Sample.travis和MySQL测试

Python 用于Django的Sample.travis和MySQL测试,python,django,travis-ci,Python,Django,Travis Ci,需要一个.travis示例yaml文件来对Django上的mysql查询进行单元测试。这是一个用于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

需要一个.travis示例yaml文件来对Django上的mysql查询进行单元测试。

这是一个用于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