From be07564b0ef774cb8c7b155022dfb1298143d36c Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Mon, 21 Oct 2024 19:43:11 +0100 Subject: [PATCH] Don't fail plot tests on rounding error (upstream seem to have _disabled_ the affected tests ...see also test_series) Author: Rebecca N. Palmer Bug-Debian: https://bugs.debian.org/1029251 Forwarded: no Gbp-Pq: Name 1029251_ignore_rounding_error.patch --- pandas/tests/plotting/frame/test_frame_subplots.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/tests/plotting/frame/test_frame_subplots.py b/pandas/tests/plotting/frame/test_frame_subplots.py index 4d8d8fa4..46b9cea2 100644 --- a/pandas/tests/plotting/frame/test_frame_subplots.py +++ b/pandas/tests/plotting/frame/test_frame_subplots.py @@ -3,6 +3,7 @@ import string import numpy as np +from numpy.testing import assert_array_almost_equal_nulp import pytest from pandas.compat import is_platform_linux @@ -435,7 +436,7 @@ class TestDataFramePlotsSubplots: # no subplots df = DataFrame({"A": [3] * 5, "B": list(range(1, 6))}, index=range(5)) ax = df.plot.bar(grid=True, log=True) - tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected) + assert_array_almost_equal_nulp(ax.yaxis.get_ticklocs(), expected, 4) @pytest.mark.xfail( np_version_gte1p24 and is_platform_linux(), @@ -449,8 +450,8 @@ class TestDataFramePlotsSubplots: log=True, subplots=True ) - tm.assert_numpy_array_equal(ax[0].yaxis.get_ticklocs(), expected) - tm.assert_numpy_array_equal(ax[1].yaxis.get_ticklocs(), expected) + assert_array_almost_equal_nulp(ax[0].yaxis.get_ticklocs(), expected, 4) + assert_array_almost_equal_nulp(ax[1].yaxis.get_ticklocs(), expected, 4) def test_boxplot_subplots_return_type_default(self, hist_df): df = hist_df -- 2.30.2