當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。