switch BAD_CASE with GOOD_CASE in iterate_me call
from joblib import Parallel, delayed
def iterate_me(n):
for i in range(n):
assert i != n-1
yield n
def identity(x):
return x
N_JOBS = 2
GOOD_CASE = N_JOBS * 2
BAD_CASE = GOOD_CASE + 1
try:
Parallel(n_jobs=N_JOBS)(delayed(identity)(i) for i in iterate_me(BAD_CASE))
print("BAD - this line should never be reached")
except Exception:
print("GOOD - this line should always be reached")
current result
BAD - this line should never be reached
expected result
GOOD - this line should always be reached
version
Python 3.11.3
joblib==1.3.1