From a6e8fa83c2fa1f0bcc3588a073e36640ca4c4ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Mar 2010 14:13:34 +0100 Subject: [PATCH] New unittest design --- tests/test_stock_location_sequence.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/test_stock_location_sequence.py b/tests/test_stock_location_sequence.py index c0bda202df..9801063b7a 100644 --- a/tests/test_stock_location_sequence.py +++ b/tests/test_stock_location_sequence.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 class StockLocationSequenceTestCase(unittest.TestCase): @@ -28,11 +31,10 @@ class StockLocationSequenceTestCase(unittest.TestCase): self.assertRaises(Exception, test_view('stock_location_sequence')) def suite(): - return unittest.TestLoader().loadTestsFromTestCase(StockLocationSequenceTestCase) + suite = trytond.tests.test_tryton.suite() + suite.addTests(unittest.TestLoader().loadTestsFromTestCase( + StockLocationSequenceTestCase)) + return suite if __name__ == '__main__': - suiteTrytond = trytond.tests.test_tryton.suite() - suiteStockLocationSequence = suite() - alltests = unittest.TestSuite([suiteTrytond, suiteStockLocationSequence]) - unittest.TextTestRunner(verbosity=2).run(alltests) - SOCK.disconnect() + unittest.TextTestRunner(verbosity=2).run(suite())