From 44693df7034b74ae07fe45e9f37149065b5635ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Mar 2015 11:38:23 +0100 Subject: [PATCH] Use separate test file for base modules This allows to filter them with the command line option. review9051002 --- trytond/tests/test_ir.py | 14 ++++++++++++++ trytond/tests/test_res.py | 14 ++++++++++++++ trytond/tests/test_tryton.py | 17 ----------------- trytond/tests/test_webdav.py | 14 ++++++++++++++ 4 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 trytond/tests/test_ir.py create mode 100644 trytond/tests/test_res.py create mode 100644 trytond/tests/test_webdav.py diff --git a/trytond/tests/test_ir.py b/trytond/tests/test_ir.py new file mode 100644 index 0000000000..70793973ed --- /dev/null +++ b/trytond/tests/test_ir.py @@ -0,0 +1,14 @@ +# 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 + +from .test_tryton import ModuleTestCase + + +class IrTestCase(ModuleTestCase): + 'Test ir module' + module = 'ir' + + +def suite(): + return unittest.TestLoader().loadTestsFromTestCase(IrTestCase) diff --git a/trytond/tests/test_res.py b/trytond/tests/test_res.py new file mode 100644 index 0000000000..46db413917 --- /dev/null +++ b/trytond/tests/test_res.py @@ -0,0 +1,14 @@ +# 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 + +from .test_tryton import ModuleTestCase + + +class ResTestCase(ModuleTestCase): + 'Test res module' + module = 'res' + + +def suite(): + return unittest.TestLoader().loadTestsFromTestCase(ResTestCase) diff --git a/trytond/tests/test_tryton.py b/trytond/tests/test_tryton.py index f40e165ae0..99d8493486 100644 --- a/trytond/tests/test_tryton.py +++ b/trytond/tests/test_tryton.py @@ -199,21 +199,6 @@ class ModuleTestCase(unittest.TestCase): }) -class IrTestCase(ModuleTestCase): - 'Test ir module' - module = 'ir' - - -class ResTestCase(ModuleTestCase): - 'Test res module' - module = 'res' - - -class WebDAVTestCase(ModuleTestCase): - 'Test webdav module' - module = 'webdav' - - def db_exist(): Database = backend.get('Database') database = Database().connect() @@ -254,8 +239,6 @@ def all_suite(modules=None): Return all tests suite of current module ''' suite_ = suite() - for case in [IrTestCase, ResTestCase, WebDAVTestCase]: - suite_.addTests(unittest.TestLoader().loadTestsFromTestCase(case)) for fn in os.listdir(os.path.dirname(__file__)): if fn.startswith('test_') and fn.endswith('.py'): if modules and fn[:-3] not in modules: diff --git a/trytond/tests/test_webdav.py b/trytond/tests/test_webdav.py new file mode 100644 index 0000000000..4957b3699b --- /dev/null +++ b/trytond/tests/test_webdav.py @@ -0,0 +1,14 @@ +# 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 + +from .test_tryton import ModuleTestCase + + +class WebDAVTestCase(ModuleTestCase): + 'Test ir module' + module = 'webdav' + + +def suite(): + return unittest.TestLoader().loadTestsFromTestCase(WebDAVTestCase)