Skip to content

Commit 7c49c8a

Browse files
Copilotthewtex
andcommitted
Fix black formatting for test assertions
Apply black code formatter's preferred style for multi-line assertions with continuation. This addresses the pre-commit CI failure. Co-authored-by: thewtex <25432+thewtex@users.noreply.github.com>
1 parent 5167f98 commit 7c49c8a

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

Wrapping/Generators/Python/Tests/extras.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -423,19 +423,24 @@ def custom_callback(name, progress):
423423
image_from_arr = itk.image_from_array(test_arr)
424424
image_from_transpose = itk.image_from_array(test_arr.T)
425425
image_from_transpose_copy = itk.image_from_array(test_arr.T.copy())
426-
assert np.array_equal(image_from_arr.shape, test_arr.shape), \
427-
f"Expected shape {test_arr.shape}, got {image_from_arr.shape}"
428-
assert np.array_equal(image_from_transpose.shape, test_arr.T.shape), \
429-
f"Expected shape {test_arr.T.shape}, got {image_from_transpose.shape}"
430-
assert np.array_equal(image_from_transpose_copy.shape, test_arr.T.shape), \
431-
f"Expected shape {test_arr.T.shape}, got {image_from_transpose_copy.shape}"
426+
assert np.array_equal(
427+
image_from_arr.shape, test_arr.shape
428+
), f"Expected shape {test_arr.shape}, got {image_from_arr.shape}"
429+
assert np.array_equal(
430+
image_from_transpose.shape, test_arr.T.shape
431+
), f"Expected shape {test_arr.T.shape}, got {image_from_transpose.shape}"
432+
assert np.array_equal(
433+
image_from_transpose_copy.shape, test_arr.T.shape
434+
), f"Expected shape {test_arr.T.shape}, got {image_from_transpose_copy.shape}"
432435
# Also verify with image_view_from_array for consistency
433436
image_view_from_arr = itk.image_view_from_array(test_arr)
434437
image_view_from_transpose = itk.image_view_from_array(test_arr.T)
435-
assert np.array_equal(image_view_from_arr.shape, test_arr.shape), \
436-
f"Expected shape {test_arr.shape}, got {image_view_from_arr.shape}"
437-
assert np.array_equal(image_view_from_transpose.shape, test_arr.T.shape), \
438-
f"Expected shape {test_arr.T.shape}, got {image_view_from_transpose.shape}"
438+
assert np.array_equal(
439+
image_view_from_arr.shape, test_arr.shape
440+
), f"Expected shape {test_arr.shape}, got {image_view_from_arr.shape}"
441+
assert np.array_equal(
442+
image_view_from_transpose.shape, test_arr.T.shape
443+
), f"Expected shape {test_arr.T.shape}, got {image_view_from_transpose.shape}"
439444
image = itk.image_from_array(arr, is_vector=True)
440445
assert image.GetImageDimension() == 2
441446
image = itk.GetImageViewFromArray(arr, is_vector=True)

0 commit comments

Comments
 (0)