From 5f5ab422edcbadb8bf0651f8fdee38fdff6f5ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 12 Mar 2010 13:48:17 +0100 Subject: [PATCH] New unittest design --- tests/test_party_siret.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/test_party_siret.py b/tests/test_party_siret.py index 9f7d4d05f2..2c2b139efb 100644 --- a/tests/test_party_siret.py +++ b/tests/test_party_siret.py @@ -2,6 +2,9 @@ #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 logging +logging.basicConfig(level=logging.FATAL) + import sys, os DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', '..', '..', '..', 'trytond'))) @@ -10,7 +13,7 @@ if os.path.isdir(DIR): import unittest import trytond.tests.test_tryton -from trytond.tests.test_tryton import RPCProxy, CONTEXT, SOCK, test_view +from trytond.tests.test_tryton import test_view from trytond.modules.party_siret import luhn @@ -58,11 +61,10 @@ class PartySiretTestCase(unittest.TestCase): def suite(): - return unittest.TestLoader().loadTestsFromTestCase(PartySiretTestCase) + suite = trytond.tests.test_tryton.suite() + suite.addTests(unittest.TestLoader().loadTestsFromTestCase( + PartySiretTestCase)) + return suite if __name__ == '__main__': - suiteTrytond = trytond.tests.test_tryton.suite() - suitePartySiret = suite() - alltests = unittest.TestSuite([suiteTrytond, suitePartySiret]) - unittest.TextTestRunner(verbosity=2).run(alltests) - SOCK.disconnect() + unittest.TextTestRunner(verbosity=2).run(suite())