コード例 #1
0
ファイル: setup.py プロジェクト: sharoonthomas/email-queue
    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)
コード例 #2
0
ファイル: setup.py プロジェクト: 2cadz/nereid-payment-gateway
    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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: setup.py プロジェクト: openlabs/itsbroken
 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())
コード例 #5
0
ファイル: setup.py プロジェクト: bala4901/nereid
    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)
コード例 #6
0
ファイル: setup.py プロジェクト: rahulsukla/nereid
    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)
コード例 #7
0
    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)
コード例 #8
0
ファイル: setup.py プロジェクト: openlabs/trytond-shipping
    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)
コード例 #9
0
ファイル: pavement.py プロジェクト: pombredanne/winlibre_pm
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)
コード例 #10
0
ファイル: setup.py プロジェクト: aroraumang/trytond-avalara
 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")
コード例 #11
0
ファイル: setup.py プロジェクト: rajatguptarg/hubot-webhook
    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)
コード例 #12
0
    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)
コード例 #13
0
    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)
コード例 #14
0
 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")
コード例 #15
0
    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)
コード例 #16
0
ファイル: setup.py プロジェクト: aroraumang/trytond-check-1
    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)
コード例 #17
0
    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)
コード例 #18
0
    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)
コード例 #19
0
ファイル: run.py プロジェクト: Anandesh-Sharma/SuperFlaskSeed
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')
コード例 #20
0
    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)
コード例 #21
0
    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)
コード例 #22
0
ファイル: setup.py プロジェクト: joeirimpan/trytond-async
    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)
コード例 #23
0
    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)
コード例 #24
0
ファイル: setup.py プロジェクト: prakashpp/trytond-async
    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)
コード例 #25
0
    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)
コード例 #26
0
    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)
コード例 #27
0
ファイル: setup.py プロジェクト: PritishC/nereid-checkout
    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)
コード例 #28
0
    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)
コード例 #29
0
ファイル: setup.py プロジェクト: openlabs/trytond-shipping
    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)
コード例 #30
0
ファイル: setup.py プロジェクト: jmesteve/openerpseda
    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)
コード例 #31
0
    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)
コード例 #32
0
ファイル: setup.py プロジェクト: Endika/magento_integration
    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)
コード例 #33
0
ファイル: setup.py プロジェクト: aroraumang/trytond-check-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)
コード例 #34
0
    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)
コード例 #35
0
ファイル: setup.py プロジェクト: trytonus/trytond-nereid-s3
    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)
コード例 #36
0
ファイル: run.py プロジェクト: sebasmagri/flask-mongokit
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")
コード例 #37
0
    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)
コード例 #38
0
    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)
コード例 #39
0
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")
コード例 #40
0
    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)
コード例 #41
0
    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)
コード例 #42
0
    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)
コード例 #43
0
import unittest
import tests

unittest.TextTestRunner(verbosity=2).run(tests.suite())
コード例 #44
0
def tests():
	import tests
	return tests.suite()
コード例 #45
0
ファイル: runtests.py プロジェクト: i386x/doit
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
コード例 #46
0
ファイル: runtests.py プロジェクト: arno01/voidwalker
#!/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()])
コード例 #47
0
ファイル: jenkins.py プロジェクト: passy/twentiment-api
#!/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()
コード例 #48
0
ファイル: main.py プロジェクト: PhotonQuantum/ee458_exm_py
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))
コード例 #49
0
ファイル: runtests.py プロジェクト: xwlan/voidwalker
#!/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()])
コード例 #50
0
ファイル: test.py プロジェクト: 4141done/hangulize
 def run(self):
     import unittest
     import tests
     suite = tests.suite(self.lang)
     unittest.TextTestRunner(verbosity=2).run(suite)
コード例 #51
0
ファイル: setup.py プロジェクト: slel/flask-autoindex
def run_tests():
    from tests import suite
    return suite()
コード例 #52
0
ファイル: setup.py プロジェクト: zbyufei/human_curl
def run_tests():
    from tests import suite
    return suite()
コード例 #53
0
from tests import suite
import unittest

ts = suite()
unittest.TextTestRunner(verbosity=2).run(ts)
コード例 #54
0
import unittest

from tests import suite

runner = unittest.TextTestRunner()
runner.run(suite())
コード例 #55
0
ファイル: factoradic.py プロジェクト: is55555/factoradic
            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())