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


Python settings.TEST_RUNNER属性代码示例

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


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

示例1: make_test_runner

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def make_test_runner(verbosity, interactive, failfast, keepdb, reverse,
                     debug_sql, parallel, tags, exclude_tags):
    if not hasattr(settings, 'TEST_RUNNER'):
        settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner'
    TestRunner = get_runner(settings)

    test_runner = TestRunner(
        verbosity=verbosity,
        interactive=interactive,
        failfast=failfast,
        keepdb=keepdb,
        reverse=reverse,
        debug_sql=debug_sql,
        parallel=actual_test_processes(parallel),
        tags=tags,
        exclude_tags=exclude_tags,
    )
    return test_runner 
开发者ID:nesdis,项目名称:djongo,代码行数:20,代码来源:setup_tests.py

示例2: get_runner

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def get_runner(settings, test_runner_class=None):
    if not test_runner_class:
        test_runner_class = settings.TEST_RUNNER

    test_path = test_runner_class.split('.')
    # Allow for Python 2.5 relative paths
    if len(test_path) > 1:
        test_module_name = '.'.join(test_path[:-1])
    else:
        test_module_name = '.'
    test_module = __import__(test_module_name, {}, {}, force_str(test_path[-1]))
    test_runner = getattr(test_module, test_path[-1])
    return test_runner 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:15,代码来源:utils.py

示例3: get_runner

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def get_runner(settings, test_runner_class=None):
    if not test_runner_class:
        test_runner_class = settings.TEST_RUNNER

    test_path = test_runner_class.split('.')
    # Allow for relative paths
    if len(test_path) > 1:
        test_module_name = '.'.join(test_path[:-1])
    else:
        test_module_name = '.'
    test_module = __import__(test_module_name, {}, {}, test_path[-1])
    test_runner = getattr(test_module, test_path[-1])
    return test_runner 
开发者ID:reBiocoder,项目名称:bioforum,代码行数:15,代码来源:utils.py

示例4: django_tests

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def django_tests(verbosity, interactive, failfast, keepdb, reverse,
                 test_labels, debug_sql, parallel, tags, exclude_tags):
    state = setup(verbosity, test_labels, parallel)
    extra_tests = []

    # Run the test suite, including the extra validation tests.
    if not hasattr(settings, 'TEST_RUNNER'):
        settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner'
    TestRunner = get_runner(settings)

    test_runner = TestRunner(
        verbosity=verbosity,
        interactive=interactive,
        failfast=failfast,
        keepdb=keepdb,
        reverse=reverse,
        debug_sql=debug_sql,
        parallel=actual_test_processes(parallel),
        tags=tags,
        exclude_tags=exclude_tags,
    )
    failures = test_runner.run_tests(
        test_labels or get_installed(),
        extra_tests=extra_tests,
    )
    teardown(state)
    return failures 
开发者ID:ra-systems,项目名称:django-ra-erp,代码行数:29,代码来源:runtests.py

示例5: get_runner

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def get_runner(settings, test_runner_class=None):
    test_runner_class = test_runner_class or settings.TEST_RUNNER
    test_path = test_runner_class.split('.')
    # Allow for relative paths
    if len(test_path) > 1:
        test_module_name = '.'.join(test_path[:-1])
    else:
        test_module_name = '.'
    test_module = __import__(test_module_name, {}, {}, test_path[-1])
    test_runner = getattr(test_module, test_path[-1])
    return test_runner 
开发者ID:PacktPublishing,项目名称:Hands-On-Application-Development-with-PyCharm,代码行数:13,代码来源:utils.py

示例6: django_tests

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def django_tests(verbosity, interactive, failfast, keepdb, reverse,
                 test_labels, debug_sql, parallel, tags, exclude_tags):
    state = setup(verbosity, test_labels, parallel)
    extra_tests = []

    # Run the test suite, including the extra validation tests.
    if not hasattr(settings, 'TEST_RUNNER'):
        settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner'

    test_runner = make_test_runner(
        verbosity=verbosity,
        interactive=interactive,
        failfast=failfast,
        keepdb=keepdb,
        reverse=reverse,
        debug_sql=debug_sql,
        parallel=parallel,
        tags=tags,
        exclude_tags=exclude_tags
    )

    result = test_runner.run_tests(
        test_labels or get_installed(),
        extra_tests=extra_tests,
    )
    teardown(state)
    return result 
开发者ID:nesdis,项目名称:djongo,代码行数:29,代码来源:setup_tests.py

示例7: django_tests

# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import TEST_RUNNER [as 别名]
def django_tests(verbosity, interactive, failfast, keepdb, reverse,
                 test_labels, debug_sql, parallel, tags, exclude_tags):
    print(verbosity, interactive, failfast, keepdb, reverse,
                 test_labels, debug_sql, parallel, tags, exclude_tags)
    state = setup(verbosity, test_labels, parallel)
    extra_tests = []

    # Run the test suite, including the extra validation tests.
    sys.path.insert(0, '/home/esidsen/projects/djongo/tests/django_tests/test_utils')
    if not hasattr(settings, 'TEST_RUNNER'):
        settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner'
    settings.TEST_RUNNER = 'test_runner.DiscoverRunner'
    TestRunner = get_runner(settings)
    print(TestRunner)

    test_runner = TestRunner(
        verbosity=verbosity,
        interactive=interactive,
        failfast=failfast,
        keepdb=keepdb,
        reverse=reverse,
        debug_sql=debug_sql,
        parallel=actual_test_processes(parallel),
        tags=tags,
        exclude_tags=exclude_tags,
    )
    failures = test_runner.run_tests(
        test_labels or get_installed(),
        extra_tests=extra_tests,
    )
    teardown(state)
    return failures 
开发者ID:nesdis,项目名称:djongo,代码行数:34,代码来源:runtests.py


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