From cb577d3179e00c558bc893ed766ea0fab7429bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 27 Jan 2015 17:23:56 +0100 Subject: [PATCH] Add tox and drone issue4431 --- .drone.yml | 9 +++++++++ tests/test_timesheet_cost.py | 3 ++- tox.ini | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 tox.ini diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000..a4d2595986 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,9 @@ +image: python2.7 +env: + - POSTGRESQL_URI=postgresql://postgres@127.0.0.1:5432/ + - MYSQL_URI=mysql://root@127.0.0.1:3306/ +script: + - pip install tox + - tox -e sqlite,postgresql +services: + - postgres diff --git a/tests/test_timesheet_cost.py b/tests/test_timesheet_cost.py index 242db5ebb3..91a0dca04f 100644 --- a/tests/test_timesheet_cost.py +++ b/tests/test_timesheet_cost.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import unittest +import doctest import datetime from decimal import Decimal @@ -72,7 +73,7 @@ def suite(): suite = trytond.tests.test_tryton.suite() from trytond.modules.company.tests import test_company for test in test_company.suite(): - if test not in suite: + if test not in suite and not isinstance(test, doctest.DocTestCase): suite.addTest(test) suite.addTests(unittest.TestLoader().loadTestsFromTestCase( TimesheetCostTestCase)) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000..e213af00e6 --- /dev/null +++ b/tox.ini @@ -0,0 +1,16 @@ +[tox] +envlist = py27-{sqlite,postgresql,mysql} + +[testenv] +commands = {envpython} setup.py test +deps = + postgresql: psycopg2 >= 2.0 + mysql: MySQL-python +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}