# Path: pyjob/local.py
# CPU_COUNT = multiprocessing.cpu_count()
# 
# Path: pyjob/pool.py
# class Pool(multiprocessing.pool.Pool):
#     """:obj:`~multiprocessing.pool.Pool` of processes to allow concurrent method calls
# 
#     Examples
#     --------
# 
#     >>> from pyjob import Pool
#     >>> with Pool(processes=2) as pool:
#     ...     pool.map(<func>, <iterable>)
# 
#     """
# 
#     def __init__(self, *args, **kwargs):
#         processes = kwargs.pop("processes") or config.get("processes") or None
#         super(Pool, self).__init__(processes=processes, *args, **kwargs)


import pytest
from pyjob.local import CPU_COUNT
from pyjob.pool import Pool



@pytest.mark.skipif(pytest.on_windows, reason="Deadlock on Windows")
class TestPool(object):
    def test_1(self):
        with Pool(processes=1) as pool:
            result = pool.map(pytest.helpers.fibonacci, [3, 4, 5])
        assert result == [1, 2, 3]

    def test_2(self):

# Path: pyjob/local.py
# CPU_COUNT = multiprocessing.cpu_count()
# 
# Path: pyjob/pool.py
# class Pool(multiprocessing.pool.Pool):
#     """:obj:`~multiprocessing.pool.Pool` of processes to allow concurrent method calls
# 
#     Examples
#     --------
# 
#     >>> from pyjob import Pool
#     >>> with Pool(processes=2) as pool:
#     ...     pool.map(<func>, <iterable>)
# 
#     """
# 
#     def __init__(self, *args, **kwargs):
#         processes = kwargs.pop("processes") or config.get("processes") or None
#         super(Pool, self).__init__(processes=processes, *args, **kwargs)


# Path: pyjob/tests/test_pool.py
import pytest
from pyjob.local import CPU_COUNT
from pyjob.pool import Pool




@pytest.mark.skipif(pytest.on_windows, reason="Deadlock on Windows")
class TestPool(object):
    def test_1(self):
        with Pool(processes=1) as pool:
            result = pool.map(pytest.helpers.fibonacci, [3, 4, 5])
        assert result == [1, 2, 3]

    def test_2(self):

        with Pool(processes=CPU_COUNT) as pool: