Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6415a5d

Browse files
committed
fix pytest
1 parent 8f00491 commit 6415a5d

File tree

2 files changed

+10
-54
lines changed

2 files changed

+10
-54
lines changed

lib/matplotlib/tests/test_image.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,14 +1814,16 @@ def test_interpolation_stage_rgba_respects_alpha_param(fig_test, fig_ref, intp_s
18141814
axs_ref[1][0].imshow(im_rgb, alpha=array_alpha)
18151815
axs_tst[1][1].imshow(im_rgba, interpolation_stage=intp_stage, alpha=scalar_alpha)
18161816
axs_ref[1][1].imshow(
1817-
np.concatenate( # combine rgb channels with scaled array alpha
1818-
(im_rgb, scalar_alpha * array_alpha.reshape((ny, nx, 1))), axis=-1
1819-
), interpolation_stage=intp_stage
1820-
)
1817+
np.concatenate(
1818+
(im_rgb,
1819+
(1 - (1 - array_alpha) * (1 - scalar_alpha)).reshape((ny, nx, 1))),
1820+
axis=-1),
1821+
interpolation_stage=intp_stage)
18211822
new_array_alpha = np.random.rand(ny, nx)
18221823
axs_tst[1][2].imshow(im_rgba, interpolation_stage=intp_stage, alpha=new_array_alpha)
18231824
axs_ref[1][2].imshow(
1824-
np.concatenate( # combine rgb channels with new array alpha
1825-
(im_rgb, new_array_alpha.reshape((ny, nx, 1))), axis=-1
1826-
), interpolation_stage=intp_stage
1827-
)
1825+
np.concatenate(
1826+
(im_rgb,
1827+
(1 - (1 - array_alpha) * (1 - new_array_alpha)).reshape((ny, nx, 1))),
1828+
axis=-1),
1829+
interpolation_stage=intp_stage)

test.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)