Skip to content

Commit bef6692

Browse files
jklymakmeeseeksmachine
authored andcommitted
Backport PR #24266: TST: Increase fp tolerance on more tests for new NumPy
1 parent dd6d054 commit bef6692

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/matplotlib/tests/test_contour.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import contourpy
66
import numpy as np
7-
from numpy.testing import assert_array_almost_equal
7+
from numpy.testing import (
8+
assert_array_almost_equal, assert_array_almost_equal_nulp)
89
import matplotlib as mpl
910
from matplotlib.testing.decorators import image_comparison
1011
from matplotlib import pyplot as plt, rc_context
@@ -313,7 +314,7 @@ def test_contourf_log_extension():
313314
cb = plt.colorbar(c1, ax=ax1)
314315
assert cb.ax.get_ylim() == (1e-8, 1e10)
315316
cb = plt.colorbar(c2, ax=ax2)
316-
assert cb.ax.get_ylim() == (1e-4, 1e6)
317+
assert_array_almost_equal_nulp(cb.ax.get_ylim(), np.array((1e-4, 1e6)))
317318
cb = plt.colorbar(c3, ax=ax3)
318319

319320

lib/matplotlib/tests/test_streamplot.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def test_startpoints():
3434
plt.plot(start_x, start_y, 'ok')
3535

3636

37-
@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20')
37+
@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20',
38+
tol=0.022)
3839
def test_colormap():
3940
X, Y, U, V = velocity_field()
4041
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,

0 commit comments

Comments
 (0)