コード例 #1
0
def test_thread_mapper_concurrency_uses_regular_map():
    with xargs._thread_mapper(1) as thread_map:
        assert thread_map is map
コード例 #2
0
def test_thread_mapper_concurrency_uses_threadpoolexecutor_map():
    with xargs._thread_mapper(10) as thread_map:
        assert isinstance(
            thread_map.__self__,
            concurrent.futures.ThreadPoolExecutor,
        ) is True
コード例 #3
0
ファイル: xargs_test.py プロジェクト: pre-commit/pre-commit
def test_thread_mapper_concurrency_uses_regular_map():
    with xargs._thread_mapper(1) as thread_map:
        assert thread_map is map
コード例 #4
0
ファイル: xargs_test.py プロジェクト: mtdev2/pre-commit
def test_thread_mapper_concurrency_uses_threadpoolexecutor_map():
    with xargs._thread_mapper(10) as thread_map:
        _self = thread_map.__self__  # type: ignore
        assert isinstance(_self, concurrent.futures.ThreadPoolExecutor)
コード例 #5
0
ファイル: xargs_test.py プロジェクト: pre-commit/pre-commit
def test_thread_mapper_concurrency_uses_threadpoolexecutor_map():
    with xargs._thread_mapper(10) as thread_map:
        assert isinstance(
            thread_map.__self__, concurrent.futures.ThreadPoolExecutor,
        ) is True