Esempio n. 1
0
def test_thread_mapper_concurrency_uses_regular_map():
    with xargs._thread_mapper(1) as thread_map:
        assert thread_map is map
Esempio n. 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
Esempio n. 3
0
def test_thread_mapper_concurrency_uses_regular_map():
    with xargs._thread_mapper(1) as thread_map:
        assert thread_map is map
Esempio n. 4
0
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)
Esempio n. 5
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