From f94ce33bea9f9b67518ce1669c2b1e84bda7a586 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 3 Dec 2021 15:35:02 -0800 Subject: [PATCH 1/2] TST: stricten xfails --- pandas/tests/io/parser/common/test_chunksize.py | 1 - pandas/tests/plotting/test_converter.py | 10 +--------- pandas/tests/plotting/test_groupby.py | 6 ------ .../tests/tseries/offsets/test_offsets_properties.py | 2 -- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/pandas/tests/io/parser/common/test_chunksize.py b/pandas/tests/io/parser/common/test_chunksize.py index 4c26047d98acc..9ad3c1328cdae 100644 --- a/pandas/tests/io/parser/common/test_chunksize.py +++ b/pandas/tests/io/parser/common/test_chunksize.py @@ -162,7 +162,6 @@ def test_chunk_begins_with_newline_whitespace(all_parsers): @pytest.mark.slow -@pytest.mark.xfail(reason="GH38630, sometimes gives ResourceWarning", strict=False) def test_chunks_have_consistent_numerical_type(all_parsers): parser = all_parsers integers = [str(i) for i in range(499999)] diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index 75f2dcacf244d..1d9b14a739848 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -10,10 +10,7 @@ import pandas._config.config as cf -from pandas.compat import ( - is_platform_windows, - np_datetime64_compat, -) +from pandas.compat import np_datetime64_compat import pandas.util._test_decorators as td from pandas import ( @@ -92,11 +89,6 @@ def test_registering_no_warning(self): ax.plot(s.index, s.values) plt.close() - @pytest.mark.xfail( - is_platform_windows(), - reason="Getting two warnings intermittently, see GH#37746", - strict=False, - ) def test_pandas_plots_register(self): plt = pytest.importorskip("matplotlib.pyplot") s = Series(range(12), index=date_range("2017", periods=12)) diff --git a/pandas/tests/plotting/test_groupby.py b/pandas/tests/plotting/test_groupby.py index 76320767a6b01..997f5abe12078 100644 --- a/pandas/tests/plotting/test_groupby.py +++ b/pandas/tests/plotting/test_groupby.py @@ -4,7 +4,6 @@ import numpy as np import pytest -from pandas.compat import is_platform_windows import pandas.util._test_decorators as td from pandas import ( @@ -20,11 +19,6 @@ @td.skip_if_no_mpl class TestDataFrameGroupByPlots(TestPlotBase): - @pytest.mark.xfail( - is_platform_windows(), - reason="Looks like LinePlot._is_ts_plot is wrong", - strict=False, - ) def test_series_groupby_plotting_nominally_works(self): n = 10 weight = Series(np.random.normal(166, 20, size=n)) diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index ef9f2390922ff..1b4fa9292c403 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -11,7 +11,6 @@ assume, given, ) -from hypothesis.errors import Flaky import pytest import pytz @@ -45,7 +44,6 @@ def test_on_offset_implementations(dt, offset): assert offset.is_on_offset(dt) == (compare == dt) -@pytest.mark.xfail(strict=False, raises=Flaky, reason="unreliable test timings") @given(YQM_OFFSET) def test_shift_across_dst(offset): # GH#18319 check that 1) timezone is correctly normalized and From 01117dd23a22a99926d9878251a411ec8484d4b1 Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 4 Dec 2021 21:54:56 -0800 Subject: [PATCH 2/2] lint fixup --- pandas/_testing/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pandas/_testing/__init__.py b/pandas/_testing/__init__.py index a89946d1f8cc8..6248154422252 100644 --- a/pandas/_testing/__init__.py +++ b/pandas/_testing/__init__.py @@ -1077,14 +1077,16 @@ def shares_memory(left, right) -> bool: if isinstance(left, NDArrayBackedExtensionArray): return shares_memory(left._ndarray, right) - if isinstance(left, pd.SparseArray): + if isinstance(left, pd.core.arrays.SparseArray): return shares_memory(left.sp_values, right) if isinstance(left, ExtensionArray) and left.dtype == "string[pyarrow]": # https://github.com/pandas-dev/pandas/pull/43930#discussion_r736862669 if isinstance(right, ExtensionArray) and right.dtype == "string[pyarrow]": - left_pa_data = left._data - right_pa_data = right._data + # error: "ExtensionArray" has no attribute "_data" + left_pa_data = left._data # type: ignore[attr-defined] + # error: "ExtensionArray" has no attribute "_data" + right_pa_data = right._data # type: ignore[attr-defined] left_buf1 = left_pa_data.chunk(0).buffers()[1] right_buf1 = right_pa_data.chunk(0).buffers()[1] return left_buf1 == right_buf1