def test_target_concurrency_testing_env_var(): with mock.patch.dict( os.environ, {'PRE_COMMIT_NO_CONCURRENCY': '1'}, clear=True, ): assert helpers.target_concurrency({'require_serial': False}) == 1
def test_target_concurrency_testing_env_var(): with mock.patch.dict( os.environ, {'PRE_COMMIT_NO_CONCURRENCY': '1'}, clear=True, ): assert helpers.target_concurrency(SERIAL_FALSE) == 1
def test_target_concurrency_cpu_count_not_implemented(): with mock.patch.object( multiprocessing, 'cpu_count', side_effect=NotImplementedError, ): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency(SERIAL_FALSE) == 1
def test_target_concurrency_on_travis(): with mock.patch.dict(os.environ, {'TRAVIS': '1'}, clear=True): assert helpers.target_concurrency(SERIAL_FALSE) == 2
def test_target_concurrency_cpu_count_require_serial_true(): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency(SERIAL_TRUE) == 1
def test_target_concurrency_normal(): with mock.patch.object(multiprocessing, 'cpu_count', return_value=123): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency(SERIAL_FALSE) == 123
def test_target_concurrency_on_travis(): with mock.patch.dict(os.environ, {'TRAVIS': '1'}, clear=True): assert helpers.target_concurrency({'require_serial': False}) == 2
def test_target_concurrency_normal(): with mock.patch.object(multiprocessing, 'cpu_count', return_value=123): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency({'require_serial': False}) == 123
def test_target_concurrency_cpu_count_not_implemented(): with mock.patch.object( multiprocessing, 'cpu_count', side_effect=NotImplementedError, ): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency(SERIAL_FALSE) == 1
def test_target_concurrency_on_travis(): with mock.patch.dict(os.environ, {'TRAVIS': '1'}, clear=True): assert helpers.target_concurrency(SERIAL_FALSE) == 2
def test_target_concurrency_testing_env_var(): with mock.patch.dict( os.environ, {'PRE_COMMIT_NO_CONCURRENCY': '1'}, clear=True, ): assert helpers.target_concurrency(SERIAL_FALSE) == 1
def test_target_concurrency_cpu_count_require_serial_true(): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency(SERIAL_TRUE) == 1
def test_target_concurrency_normal(): with mock.patch.object(multiprocessing, 'cpu_count', return_value=123): with mock.patch.dict(os.environ, {}, clear=True): assert helpers.target_concurrency(SERIAL_FALSE) == 123