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/setup.py b/setup.py index 9ee07f56db..776191e37c 100644 --- a/setup.py +++ b/setup.py @@ -85,4 +85,6 @@ setup(name=name, [trytond.modules] account_be = trytond.modules.account_be """, + test_suite='tests', + test_loader='trytond.test_loader:Loader', ) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000..2042926c44 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,6 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +from .test_account_be import suite + +__all__ = ['suite'] diff --git a/tests/test_account_be.py b/tests/test_account_be.py new file mode 100644 index 0000000000..a38c0f098c --- /dev/null +++ b/tests/test_account_be.py @@ -0,0 +1,17 @@ +# 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 trytond.tests.test_tryton +from trytond.tests.test_tryton import ModuleTestCase + + +class AccountBETestCase(ModuleTestCase): + 'Test Account BE module' + module = 'account_be' + + +def suite(): + suite = trytond.tests.test_tryton.suite() + suite.addTests(unittest.TestLoader().loadTestsFromTestCase( + AccountBETestCase)) + return suite 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}