當前位置: 首頁>>代碼示例>>Python>>正文


Python core.TestProgram方法代碼示例

本文整理匯總了Python中nose.core.TestProgram方法的典型用法代碼示例。如果您正苦於以下問題:Python core.TestProgram方法的具體用法?Python core.TestProgram怎麽用?Python core.TestProgram使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nose.core的用法示例。


在下文中一共展示了core.TestProgram方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _execPlugin

# 需要導入模塊: from nose import core [as 別名]
# 或者: from nose.core import TestProgram [as 別名]
def _execPlugin(self):
        """execute the plugin on the internal test suite.
        """
        from nose.config import Config
        from nose.core import TestProgram
        from nose.plugins.manager import PluginManager

        suite = None
        stream = Buffer()
        conf = Config(env=self.env,
                      stream=stream,
                      plugins=PluginManager(plugins=self.plugins))
        if self.ignoreFiles is not None:
            conf.ignoreFiles = self.ignoreFiles
        if not self.suitepath:
            suite = self.makeSuite()

        self.nose = TestProgram(argv=self.argv, config=conf, suite=suite,
                                exit=False)
        self.output = AccessDecorator(stream) 
開發者ID:adde88,項目名稱:hostapd-mana,代碼行數:22,代碼來源:plugintest.py

示例2: test_lessons_solutions

# 需要導入模塊: from nose import core [as 別名]
# 或者: from nose.core import TestProgram [as 別名]
def test_lessons_solutions(grep=None, units=None, exit=True):

    with TemporaryDirectory() as temp_dir:
        abs_path = os.path.abspath(temp_dir)
        for lesson in iter_code_lessons(grep=grep, units=units):
            for solution in iter_lesson_solutions(lesson):
                write_solution_test_file(temp_dir, solution)

        suite = unittest.TestLoader().discover(abs_path)
        program = TestProgram(suite=suite, exit=False, argv=sys.argv[0:1])

        if exit:
            sys.exit(int(not program.success))

        return program 
開發者ID:rmotr-curriculum,項目名稱:flask-tutorial-step-by-step,代碼行數:17,代碼來源:run_tests.py

示例3: main

# 需要導入模塊: from nose import core [as 別名]
# 或者: from nose.core import TestProgram [as 別名]
def main():
    """Invoke Nose's `TestProgram` with extra plugins.

    At the command-line it's still necessary to enable these with the flags
    ``--with-crochet``, ``--with-resources``, ``--with-scenarios``, and so on.
    """
    return TestProgram(addplugins=(
        Crochet(), Resources(), Scenarios(), Select(), SelectBucket(),
        Subunit())) 
開發者ID:maas,項目名稱:maas,代碼行數:11,代碼來源:noseplug.py


注:本文中的nose.core.TestProgram方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。