当前位置: 首页>>代码示例>>Python>>正文


Python nose.main方法代码示例

本文整理汇总了Python中nose.main方法的典型用法代码示例。如果您正苦于以下问题:Python nose.main方法的具体用法?Python nose.main怎么用?Python nose.main使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nose的用法示例。


在下文中一共展示了nose.main方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
    args, otherargs = parse_args()

    if args.no_local_import:
        # Remove the current directory from the import path
        exclude_sys_path('.')

    remove_f('.coverage')

    nose.main(
        argv = [
            'nosetests',

            '-v',
            '--with-coverage',
            '--cover-inclusive',
            '--cover-package=scuba',
            '--detailed-errors',
            '--process-timeout=60',
        ] + otherargs,
    ) 
开发者ID:JonathonReinhart,项目名称:scuba,代码行数:23,代码来源:run_nosetests.py

示例2: main

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
    nose.main(addplugins=[NoseSQLAlchemy()]) 
开发者ID:jpush,项目名称:jbox,代码行数:4,代码来源:runner.py

示例3: setup_py_test

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def setup_py_test():
    """Runner to use for the 'test_suite' entry of your setup.py.

    Prevents any name clash shenanigans from the command line
    argument "test" that the "setup.py test" command sends
    to nose.

    """
    nose.main(addplugins=[NoseSQLAlchemy()], argv=['runner']) 
开发者ID:jpush,项目名称:jbox,代码行数:11,代码来源:runner.py

示例4: main

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
    environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
    
    # setup path
    test_dir = dirname(dirname(abspath(__file__)))
    sys.path.insert(0, test_dir)
    
    try:
        # django >= 1.7
        from django import setup
    except ImportError:
        pass
    else:
        setup()
    
    # setup test env
    from django.test.utils import setup_test_environment
    setup_test_environment()
    
    # setup db
    from django.core.management import call_command, CommandError
    options = {
        'interactive': False,
        'verbosity': 1,
    }
    try:
        call_command('migrate', **options)
    except CommandError:  # Django < 1.7
        call_command('syncdb', **options)
    
    # run tests
    return nose.main() 
开发者ID:dfunckt,项目名称:django-connections,代码行数:34,代码来源:runtests.py

示例5: anyblok_nose

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def anyblok_nose():
    """Run nose unit test after giving it the registry
    """
    warnings.simplefilter('default')
    warnings.warn(
        "This script is deprecated and will be removed soon. "
        "The Nose test machinery has been removed from the framework in order "
        "to be replaced with Pytest. "
        "If you need to run your tests with nose, install the Nose package.",
        DeprecationWarning, stacklevel=2)

    try:
        from nose import main
    except ImportError:
        logger.error('"Nosetest" is not installed, try: pip install nose')

    registry = anyblok.start('nose', useseparator=True, unittest=True)

    if registry:
        installed_bloks = registry.System.Blok.list_by_state("installed")
        selected_bloks = return_list(
            Configuration.get('selected_bloks')) or installed_bloks

        unwanted_bloks = return_list(
            Configuration.get('unwanted_bloks')) or []
        unwanted_bloks.extend(['anyblok-core', 'anyblok-test', 'model_authz'])

        defaultTest = []
        for blok in installed_bloks:
            if blok not in selected_bloks or blok in unwanted_bloks:
                continue

            startpath = BlokManager.getPath(blok)
            for root, dirs, _ in walk(startpath):
                if 'tests' in dirs:
                    defaultTest.append(join(root, 'tests'))

        registry.close()  # free the registry to force create it again

    sys.exit(main(defaultTest=defaultTest)) 
开发者ID:AnyBlok,项目名称:AnyBlok,代码行数:42,代码来源:scripts.py

示例6: run_tests

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def run_tests(self):
        import nose
        sys.exit(nose.main(argv=self.argv)) 
开发者ID:Mulugruntz,项目名称:celery-pubsub,代码行数:5,代码来源:setup.py

示例7: run

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def run():
    os.environ["NOSE_WITH_COVERAGE"] = "1"
    os.environ['NOSE_COVER_PACKAGE'] = 'emva1288'
    os.environ["NOSE_COVER_HTML"] = "1"
    os.environ["NOSE_COVER_ERASE"] = "1"
    nose.main(defaultTest=default_test_modules) 
开发者ID:EMVA1288,项目名称:emva1288,代码行数:8,代码来源:tests.py

示例8: setup_py_test

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def setup_py_test():
    """Runner to use for the 'test_suite' entry of your setup.py.

    Prevents any name clash shenanigans from the command line
    argument "tests" that the "setup.py tests" command sends
    to nose.

    """
    nose.main(addplugins=[NoseSQLAlchemy()], argv=['runner']) 
开发者ID:gltn,项目名称:stdm,代码行数:11,代码来源:runner.py

示例9: run

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def run(self, parser, args):
        import nose
        sys.argv = [sys.argv[0]] + args.nose_args
        if 'RELENGAPI_SETTINGS' in os.environ:
            del os.environ['RELENGAPI_SETTINGS']
        # enable sqlalchemy logging
        logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
        # push a fake app context to avoid tests accidentally using the
        # runtime app context (for example, the development DB)
        with Flask(__name__).app_context():
            nose.main(addplugins=[ResetLogging()]) 
开发者ID:mozilla,项目名称:build-relengapi,代码行数:13,代码来源:__init__.py

示例10: main

# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
    nose.main() 
开发者ID:broadinstitute,项目名称:fiss,代码行数:4,代码来源:highlevel_tests.py


注:本文中的nose.main方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。