Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,9 @@ def test_pcolor_log_scale(fig_test, fig_ref):
when using pcolor.
"""
x = np.linspace(0, 1, 11)
# Ensuring second x value always falls slightly above 0.1 prevents flakiness with
# numpy v1 #30882. This can be removed once we require numpy >= 2.
x[1] += 0.00001
y = np.linspace(1, 2, 5)
X, Y = np.meshgrid(x, y)
C = X[:-1, :-1] + Y[:-1, :-1]
Expand Down
7 changes: 5 additions & 2 deletions lib/matplotlib/tests/test_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from packaging.version import parse as parse_version

import numpy as np
from numpy.testing import assert_almost_equal, assert_array_equal
from numpy.testing import assert_almost_equal, assert_array_equal, assert_allclose
import pytest

import matplotlib as mpl
Expand Down Expand Up @@ -1935,7 +1935,10 @@ def test_bad_locator_subs(sub):
@mpl.style.context('default')
def test_small_range_loglocator(numticks, lims, ticks):
ll = mticker.LogLocator(numticks=numticks)
assert_array_equal(ll.tick_values(*lims), ticks)
if parse_version(np.version.version).major < 2:
assert_allclose(ll.tick_values(*lims), ticks, rtol=2e-16)
else:
assert_array_equal(ll.tick_values(*lims), ticks)


@mpl.style.context('default')
Expand Down
4 changes: 3 additions & 1 deletion lib/mpl_toolkits/mplot3d/tests/test_axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import platform
import sys

from packaging.version import parse as parse_version
import pytest

from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d, art3d
Expand Down Expand Up @@ -181,7 +182,8 @@ def test_bar3d_shaded():
fig.canvas.draw()


@mpl3d_image_comparison(['bar3d_notshaded.png'], style='mpl20')
@mpl3d_image_comparison(['bar3d_notshaded.png'], style='mpl20',
tol=0.01 if parse_version(np.version.version).major < 2 else 0)
def test_bar3d_notshaded():
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
Expand Down
Loading