コード例 #1
0
	def run_all(self):
		tests = defaultTestLoader.discover(self._path)

		testRunner = runner.TextTestRunner()
		result = testRunner.run(tests)

		sys.exit(not result.wasSuccessful())
コード例 #2
0
ファイル: custom_script.py プロジェクト: mat2uken/myojin
    def run(self, config, startdir, pattern):

        if not pattern.endswith('.py'):
            pattern = 'test_%s.py' % pattern

        #app = config_from_file(config)
        app = config_from_file(config, defaults=('test.cfg','base.cfg'))

        if not startdir:
            startdir = app.root_path
        import unittest
        from unittest import runner

        testRunner = runner.TextTestRunner()
        loader = TestLoader()
        self.test =  loader.discover(startdir, top_level_dir=app.root_path +"/..", pattern=pattern)
        self.result = testRunner.run(self.test)
        import sys
        sys.exit()
コード例 #3
0
ファイル: manager.py プロジェクト: Danilodcn/ServerTCC
def tests():
    loader = TestLoader()
    test = loader.discover("tests/")
    testrunner = runner.TextTestRunner()
    testrunner.run(test)
コード例 #4
0
def tests_codewars():
    loader = TestLoader()
    test = loader.discover('codewars/tests/')
    testrunner = runner.TextTestRunner()
    testrunner.run(test)
コード例 #5
0
def tests():
    loader = TestLoader()
    tests = loader.discover('tests/')
    testRunner = runner.TextTestRunner()
    testRunner.run(tests)
コード例 #6
0
def tests():
    app.testing = True
    loader = TestLoader()
    tests = loader.discover('source/tests/')
    testRunner = runner.TextTestRunner()
    testRunner.run(tests)
コード例 #7
0
#!/usr/bin/env python
import os
import __init__
from unittest import TestLoader, runner

this_dir = os.path.dirname(__file__)

dirs = ["pagemodel", "addon", "libdict", ]

loader = TestLoader()

tests = [loader.discover(os.path.join(this_dir, d), top_level_dir=this_dir) for d in dirs]

testRunner = runner.TextTestRunner()
for test in tests:
    testRunner.run(test)
コード例 #8
0
ファイル: mqunit.py プロジェクト: tillfall/pyunit_on_mq
 def __init__(self, casedir):
     self.casedir = casedir
     self.runner = runner.TextTestRunner()