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

Skip to content

Commit 4b8bf0b

Browse files
committed
Suppress some warnings in tests.
1 parent 3c86054 commit 4b8bf0b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/matplotlib/tests/test_scale.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from matplotlib.testing.decorators import check_figures_equal, image_comparison
1+
from matplotlib.cbook import MatplotlibDeprecationWarning
22
import matplotlib.pyplot as plt
33
from matplotlib.scale import Log10Transform, InvertedLog10Transform
4+
from matplotlib.testing.decorators import check_figures_equal, image_comparison
45

56
import numpy as np
67
import io
@@ -91,7 +92,8 @@ def test_logscale_invert_transform():
9192
tform = (ax.transAxes + ax.transData.inverted()).inverted()
9293

9394
# direct test of log transform inversion
94-
assert isinstance(Log10Transform().inverted(), InvertedLog10Transform)
95+
with pytest.warns(MatplotlibDeprecationWarning):
96+
assert isinstance(Log10Transform().inverted(), InvertedLog10Transform)
9597

9698

9799
def test_logscale_transform_repr():
@@ -101,7 +103,8 @@ def test_logscale_transform_repr():
101103
s = repr(ax.transData)
102104

103105
# check that repr of log transform succeeds
104-
s = repr(Log10Transform(nonpos='clip'))
106+
with pytest.warns(MatplotlibDeprecationWarning):
107+
s = repr(Log10Transform(nonpos='clip'))
105108

106109

107110
@image_comparison(baseline_images=['logscale_nonpos_values'], remove_text=True,

0 commit comments

Comments
 (0)