runner.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:django-next-train 作者: bitpixdigital 项目源码 文件源码
def default_test_processes():
    """
    Default number of test processes when using the --parallel option.
    """
    # The current implementation of the parallel test runner requires
    # multiprocessing to start subprocesses with fork().
    # On Python 3.4+: if multiprocessing.get_start_method() != 'fork':
    if not hasattr(os, 'fork'):
        return 1
    try:
        return int(os.environ['DJANGO_TEST_PROCESSES'])
    except KeyError:
        return multiprocessing.cpu_count()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号