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

Skip to content

Commit 1d720c4

Browse files
authored
Merge pull request #9307 from matplotlib/auto-backport-of-pr-9303
Backport PR #9303 on branch v2.1.x
2 parents 01871e4 + a1c3db2 commit 1d720c4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/matplotlib/tests/test_image.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,12 @@ def test_imshow_flatfield():
806806
colors.LogNorm,
807807
lambda: colors.SymLogNorm(1),
808808
lambda: colors.PowerNorm(1)])
809-
@pytest.mark.filterwarnings("ignore:Attempting to set identical left==right")
810809
def test_empty_imshow(make_norm):
811810
fig, ax = plt.subplots()
812-
im = ax.imshow([[]], norm=make_norm())
811+
with warnings.catch_warnings():
812+
warnings.filterwarnings(
813+
"ignore", "Attempting to set identical left==right")
814+
im = ax.imshow([[]], norm=make_norm())
813815
im.set_extent([-5, 5, -5, 5])
814816
fig.canvas.draw()
815817

0 commit comments

Comments
 (0)