当前位置: 首页>>代码示例>>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;未经允许,请勿转载。