Add tox and travis

This commit is contained in:
Sergi Almacellas Abellana 2016-09-29 13:12:06 +02:00
parent f5604334eb
commit da7bf25266
2 changed files with 40 additions and 0 deletions

22
.travis.yml Normal file
View File

@ -0,0 +1,22 @@
language: python
install:
- pip install tox
services:
- postgresql
script:
- tox
env:
global:
- POSTGRESQL_URI=postgresql://postgres:@localhost:5432/
matrix:
- TOXENV=py27-sqlite
- TOXENV=py27-postgresql
- TOXENV=py34-sqlite
- TOXENV=py34-postgresql
notifications:
irc:
channels:
- "chat.freenode.net#trytonspain-ci"
on_success: change
on_failure: always
skip_join: true

18
tox.ini Normal file
View File

@ -0,0 +1,18 @@
[tox]
envlist = {py27,py33,py34,py35}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
[testenv]
commands = {envpython} setup.py test
deps =
{py27,py33,py34,py35}-postgresql: psycopg2 >= 2.5
pypy-postgresql: psycopg2cffi >= 2.5
mysql: MySQL-python
sqlite: sqlitebck
setenv =
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://}
mysql: TRYTOND_DATABASE_URI={env:MYSQL_URI:mysql://}
sqlite: DB_NAME={env:SQLITE_NAME::memory:}
postgresql: DB_NAME={env:POSTGRESQL_NAME:test}
mysql: DB_NAME={env:MYSQL_NAME:test}
install_command = pip install --pre --find-links https://trydevpi.tryton.org/ {opts} {packages}