New unittest design

This commit is contained in:
Cédric Krier
2010-03-04 14:12:31 +01:00
parent 91d226d0b0
commit 32ef284e36
@@ -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 PurchaseInvoiceLineStandaloneTestCase(unittest.TestCase):
@@ -30,13 +33,10 @@ class PurchaseInvoiceLineStandaloneTestCase(unittest.TestCase):
'purchase_invoice_line_standalone'))
def suite():
return unittest.TestLoader().loadTestsFromTestCase(
PurchaseInvoiceLineStandaloneTestCase)
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
PurchaseInvoiceLineStandaloneTestCase))
return suite
if __name__ == '__main__':
suiteTrytond = trytond.tests.test_tryton.suite()
suitePurchaseInvoiceLineStandalone = suite()
alltests = unittest.TestSuite([suiteTrytond,
suitePurchaseInvoiceLineStandalone])
unittest.TextTestRunner(verbosity=2).run(alltests)
SOCK.disconnect()
unittest.TextTestRunner(verbosity=2).run(suite())