Skip to content

Commit 167a7f4

Browse files
committed
prettify test file
1 parent e19b2f2 commit 167a7f4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/utils/test_parallelize.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def vanilla_func(x, y) -> np.ndarray:
4343

4444

4545
def mock_runner(x, y, queue, function):
46-
for i in range(len(x)):
47-
x[i] = function(x[i], y, check_threads=True)
46+
for i, xi in enumerate(x):
47+
x[i] = function(xi, y, check_threads=True)
4848
if queue is not None:
4949
queue.put(Signal.UPDATE)
5050
if queue is not None:
@@ -72,7 +72,7 @@ def test_parallelize_loky(func, n_jobs):
7272
arr2 = np.arange(n)
7373
runner = partial(mock_runner, function=func)
7474
# this is the expected result of the function
75-
expected = [func(arr1[i], arr2, check_threads=False) for i in range(len(arr1))]
75+
expected = [func(a1, arr2, check_threads=False) for a1 in arr1]
7676
# this will be set to something other than 1,2,8
7777
# we want to check if setting the threads works
7878
# then after the function is run if the numba cores are set back to 1

0 commit comments

Comments
 (0)