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

Skip to content

Commit e97155b

Browse files
committed
TST: Remove the callback from axes_grid test
This test puts multiple colorbars into the same cax axes and some state gets kept due to the callbacks immediately updating the cax the first time around.
1 parent b56d4c9 commit e97155b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/mpl_toolkits/tests/test_axes_grid.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def test_imagegrid_cbar_mode_edge():
4343

4444
for ax in grid:
4545
ax.cax.cla()
46-
cb = ax.cax.colorbar(ax.images[0])
46+
ax.cax.colorbar(ax.images[0])
47+
# Remove the callback because we are putting colorbars onto
48+
# the same cax
49+
ax.images[0].callbacksSM.disconnect(ax.images[0].colorbar_cid)
4750

4851

4952
def test_imagegrid():

0 commit comments

Comments
 (0)