本文整理汇总了Python中tests.suite函数的典型用法代码示例。如果您正苦于以下问题:Python suite函数的具体用法?Python suite怎么用?Python suite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了suite函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
def run(self):
from openerp.tools import config
config.options['db_user'] = 'postgres'
config.options['db_host'] = 'localhost'
config.options['db_port'] = 5432
from tests import suite
unittest.TextTestRunner(verbosity=3).run(suite())
示例2: run
def run(self):
from trytond.config import CONFIG
CONFIG['db_type'] = 'postgresql'
CONFIG['db_host'] = 'localhost'
CONFIG['db_port'] = 5432
CONFIG['db_user'] = 'postgres'
CONFIG['timezone'] = 'UTC'
from trytond import backend
import trytond.tests.test_tryton
# Set the db_type again because test_tryton writes this to sqlite
# again
CONFIG['db_type'] = 'postgresql'
trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
from trytond.tests.test_tryton import DB_NAME
trytond.tests.test_tryton.DB = backend.get('Database')(DB_NAME)
from trytond.pool import Pool
Pool.test = True
trytond.tests.test_tryton.POOL = Pool(DB_NAME)
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例3: run
def run(self):
# Set timezone in environment.
os.environ['TZ'] = 'UTC'
def set_config():
from trytond.config import CONFIG
CONFIG['db_type'] = 'postgresql'
CONFIG['db_host'] = 'localhost'
CONFIG['db_port'] = 5432
CONFIG['db_user'] = 'postgres'
from trytond.backend.postgresql import Database
import trytond.tests.test_tryton
# Needed for the database loader to load correctly
set_config()
trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
from trytond.tests.test_tryton import DB_NAME
trytond.tests.test_tryton.DB = Database(DB_NAME)
from trytond.pool import Pool
Pool.test = True
trytond.tests.test_tryton.POOL = Pool(DB_NAME)
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例4: run
def run(self):
# Set timezone in environment.
os.environ['TZ'] = 'UTC'
def set_config():
os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
from trytond.backend.postgresql import Database
import trytond.tests.test_tryton
# Needed for the database loader to load correctly
set_config()
trytond.tests.test_tryton.DB_NAME = 'test_' + str(int(time.time()))
from trytond.tests.test_tryton import DB_NAME
trytond.tests.test_tryton.DB = Database(DB_NAME)
from trytond.pool import Pool
Pool.test = True
trytond.tests.test_tryton.POOL = Pool(DB_NAME)
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例5: run
def run(self):
os.environ['DB_NAME'] = ':memory:'
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例6: test
def test():
import unittest
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
import tests
suite = tests.suite(options.args)
unittest.TextTestRunner(verbosity=2).run(suite)
示例7: run
def run(self):
import coverage
import xmlrunner
cov = coverage.coverage(source=["trytond.modules.avatax_calc"])
cov.start()
from tests import suite
xmlrunner.XMLTestRunner(output="xml-test-results").run(suite())
cov.stop()
cov.save()
cov.xml_report(outfile="coverage.xml")
示例8: run
def run(self):
if self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require)
from tests import suite
test_result = unittest.TextTestRunner(verbosity=2).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例9: run
def run(self):
os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例10: run
def run(self):
from trytond.config import CONFIG
CONFIG['db_type'] = 'sqlite'
os.environ['DB_NAME'] = ':memory:'
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例11: run
def run(self):
os.environ["TRYTOND_DATABASE_URI"] = "sqlite://"
os.environ["DB_NAME"] = ":memory:"
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例12: run
def run(self):
if self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require)
os.environ['TRYTOND_DATABASE_URI'] = "sqlite://"
os.environ['DB_NAME'] = ':memory:'
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例13: run
def run(self):
if self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require)
os.environ['TRYTOND_DATABASE_URI'] = 'postgresql://'
os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例14: run
def run(self):
os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
os.environ['TRYTOND_DATABASE_URI'] = "postgresql://"
os.environ['TRYTOND_ASYNC__BROKER_URL'] = "redis://localhost:6379/0"
os.environ['TRYTOND_ASYNC__BACKEND_URL'] = "redis://localhost:6379/1"
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)
示例15: run
def run(self):
from trytond.config import config
config.set("database", "uri", "postgresql://postgres:[email protected]:5432/")
os.environ["DB_NAME"] = "test_" + str(int(time.time()))
from tests import suite
test_result = unittest.TextTestRunner(verbosity=3).run(suite())
if test_result.wasSuccessful():
sys.exit(0)
sys.exit(-1)