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'] = '******' 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)
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)
def run(self): from openerp.tools import config config.options['db_user'] = '******' config.options['db_host'] = 'localhost' config.options['db_port'] = 5432 from tests import suite unittest.TextTestRunner(verbosity=3).run(suite())
def run(self): from trytond.config import CONFIG CONFIG['db_type'] = 'postgresql' CONFIG['db_host'] = 'localhost' CONFIG['db_port'] = 5432 CONFIG['db_user'] = '******' 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)
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)
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)
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")
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)
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)
def run(self): import coverage import xmlrunner cov = coverage.coverage(source=["trytond.modules.nereid"]) cov.start() from tests import suite xmlrunner.XMLTestRunner(output="xml-test-results").run(suite()) cov.stop() cov.save() cov.xml_report(outfile="coverage.xml")
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)
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)
def run(): cov = coverage(source=['flask_testing']) cov.start() from tests import suite result = unittest.TextTestRunner(verbosity=2).run(suite()) if not result.wasSuccessful(): sys.exit(1) cov.stop() print("\nCode Coverage") cov.report() cov.html_report(directory='cover')
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)
def run(self): if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) 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)
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)
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)
def run(self): from trytond.config import config config.set('database', 'uri', 'postgresql://*****:*****@localhost: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)
def run(self): if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) 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)
def run(self): from trytond.config import config config.set("database", "uri", "postgresql://*****:*****@localhost: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)
def run(self): from trytond.config import config config.set( 'database', 'uri', 'postgresql://*****:*****@localhost: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)
def run(self): from openerp.tools import config config.options['db_user'] = '******' config.options['db_host'] = 'localhost' config.options['db_port'] = 5432 parent_folder, current_folder = os.path.dirname( os.path.abspath(__file__)).rsplit('/', 1) config.options['addons_path'] += ',' + parent_folder from tests import suite test_result = unittest.TextTestRunner(verbosity=3).run(suite()) if test_result.wasSuccessful(): sys.exit(0) sys.exit(-1)
def run(self): from trytond.config import CONFIG CONFIG['db_type'] = 'postgresql' CONFIG['db_host'] = 'localhost' CONFIG['db_port'] = 5432 CONFIG['db_user'] = '******' 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)
def run(self): from openerp.tools import config config.options['db_user'] = '******' config.options['db_host'] = 'localhost' config.options['db_port'] = 5432 parent_folder, current_folder = os.path.dirname( os.path.abspath(__file__) ).rsplit('/', 1) config.options['addons_path'] += ',' + parent_folder from tests import suite test_result = unittest.TextTestRunner(verbosity=3).run(suite()) if test_result.wasSuccessful(): sys.exit(0) sys.exit(-1)
def run(self): if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) from trytond.config import config os.environ['TRYTOND_DATABASE_URI'] = 'sqlite://' config.set('email', 'from', '*****@*****.**') 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)
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 trytond.config import config config.add_section('nereid_s3') from tests import suite test_result = unittest.TextTestRunner(verbosity=3).run(suite()) if test_result.wasSuccessful(): sys.exit(0) sys.exit(-1)
def run(): if coverage_available: cov = coverage(source=['flask_mongokit']) cov.start() from tests import suite unittest.TextTestRunner(verbosity=2).run(suite()) if coverage_available: cov.stop() print "\nCode Coverage" cov.report() cov.html_report(directory='cover') else: print("\nTipp:\n\tUse 'pip install coverage' to get great code " "coverage stats")
def run(self): if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) from trytond.config import config os.environ["TRYTOND_DATABASE_URI"] = "sqlite://" config.set("email", "from", "*****@*****.**") 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)
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 trytond.config import config # Add elastic search test configuration config.add_section('elastic_search') config.set('elastic_search', 'server_uri', 'localhost:9200') from tests import suite test_result = unittest.TextTestRunner(verbosity=3).run(suite()) if test_result.wasSuccessful(): sys.exit(0) sys.exit(-1)
def run(): if coverage_available: cov = coverage(source=['skf']) cov.start() from tests import suite result = unittest.TextTestRunner(verbosity=2).run(suite()) if not result.wasSuccessful(): sys.exit(1) if coverage_available: cov.stop() print("\nCode Coverage") cov.report() cov.html_report(directory='cover') else: print("\nTipp:\n\tUse 'pip install coverage' to get great code " "coverage stats")
def run(self): if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) from trytond.config import CONFIG CONFIG['db_type'] = 'postgresql' CONFIG['db_host'] = 'localhost' CONFIG['db_port'] = 5432 CONFIG['db_user'] = '******' CONFIG['smtp_from'] = '*****@*****.**' 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)
import unittest import tests unittest.TextTestRunner(verbosity=2).run(tests.suite())
def tests(): import tests return tests.suite()
class _WriteDecorator(object): __slots__ = [ 'stream' ] def __init__(self, stream): self.stream = stream #-def def __getattr__(self, attr): if attr in ('stream', '__getstate__'): return AttributeError(attr) return getattr(self.stream, attr) #-def def write(self, text): try: self.stream.write(text) except UnicodeEncodeError: bytes = text.encode(self.stream.encoding, 'backslashreplace') if hasattr(self.stream, 'buffer'): self.stream.buffer.write(bytes) else: text = bytes.decode(self.stream.encoding, 'strict') self.stream.write(text) #-def #-class if __name__ == '__main__': stream = _WriteDecorator(sys.stdout) unittest.TextTestRunner(stream, True, 2).run(tests.suite()) #-if
#!/usr/bin/env python # (void)walker unit tests # Copyright (C) 2012 David Holm <*****@*****.**> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import sys import unittest import tests suite = tests.suite() runner = unittest.TextTestRunner(verbosity=2) result = runner.run(suite) sys.exit({True: 0, False: 3}[result.wasSuccessful()])
#!/usr/bin/env python import xmlrunner import coverage from tests import suite if __name__ == '__main__': cov = coverage.coverage() cov.erase() cov.start() xmlrunner.XMLTestRunner(output='test-reports').run(suite()) cov.stop() cov.save() cov.xml_report()
import unittest import tests import definition import fixed_definition if __name__ == '__main__': runner = unittest.TextTestRunner(verbosity=2) runner.run(tests.suite(definition.Account, definition.Advertiser)) runner.run( tests.suite(fixed_definition.Account, fixed_definition.Advertiser))
def run(self): import unittest import tests suite = tests.suite(self.lang) unittest.TextTestRunner(verbosity=2).run(suite)
def run_tests(): from tests import suite return suite()
from tests import suite import unittest ts = suite() unittest.TextTestRunner(verbosity=2).run(ts)
import unittest from tests import suite runner = unittest.TextTestRunner() runner.run(suite())
res.append(elements.pop(factoradic_value[i])) return res @staticmethod def generate_permutation_from_factoradic( factoradic_value, elements): # helper to avoid modifying any parameters return Factoradic.generate_permutation_from_factoradic_inplace( factoradic_value, elements[:]) @staticmethod def padded_to_length_s(factoradic_value, new_len): if len(factoradic_value) < new_len: diff = new_len - len(factoradic_value) padding = [0] * diff padding.extend(factoradic_value) return padding return factoradic_value if __name__ == "__main__": import tests suite = tests.unittest.TestLoader().loadTestsFromTestCase( tests.TestCaseFactoradicLowlevel) suite.addTests(tests.unittest.TestLoader().loadTestsFromTestCase( tests.TestCaseFactoradicObject)) tests.unittest.TextTestRunner(verbosity=2).run(suite) tests.unittest.TestSuite(tests.suite())