def test_basic_without_using_shared_data(self): """Ensure that USE_SHARED_DATA is false the function is called and do not use the cached data """ enable_shared_function(False) value = gen_integer(min_value=1, max_value=10000) increment_by = gen_integer(min_value=1, max_value=10000) new_value = basic_shared_counter(index=value, increment_by=increment_by) self.assertEqual(new_value, value + increment_by) second_new_value = basic_shared_counter(index=new_value, increment_by=increment_by) self.assertEqual(second_new_value, new_value + increment_by)
def test_basic_without_using_shared_data(self): """Ensure that USE_SHARED_DATA is false the function is called and do not use the cached data """ enable_shared_function(False) value = gen_integer(min_value=1, max_value=10000) increment_by = gen_integer(min_value=1, max_value=10000) new_value = basic_shared_counter( index=value, increment_by=increment_by) self.assertEqual(new_value, value+increment_by) second_new_value = basic_shared_counter( index=new_value, increment_by=increment_by) self.assertEqual(second_new_value, new_value + increment_by)
def enable(self): enable_shared_function(True)
def setUp(self): enable_shared_function(True) self.pool_size = DEFAULT_POOL_SIZE self.pool = multiprocessing.Pool(self.pool_size)
def setUp(self): enable_shared_function(True) self.pool_size = DEFAULT_POOL_SIZE self.pool = multiprocessing.Pool(self.pool_size)