From 05ba3f3f91d669f25ee8396ea1c128ffc7a2bd78 Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 23 Jan 2021 15:48:47 -0800 Subject: [PATCH 1/8] TST/WIP: stricter xfails --- pandas/tests/arrays/sparse/test_arithmetics.py | 4 ++-- pandas/tests/io/json/test_pandas.py | 1 - pandas/tests/io/parser/test_network.py | 4 ++-- pandas/tests/io/test_parquet.py | 1 - pandas/tests/plotting/frame/test_frame.py | 16 ++++++++++------ pandas/tests/plotting/test_converter.py | 1 - pandas/tests/plotting/test_groupby.py | 1 - 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandas/tests/arrays/sparse/test_arithmetics.py b/pandas/tests/arrays/sparse/test_arithmetics.py index 013814681b5f6..f7376f8360199 100644 --- a/pandas/tests/arrays/sparse/test_arithmetics.py +++ b/pandas/tests/arrays/sparse/test_arithmetics.py @@ -124,7 +124,7 @@ def test_float_scalar( if not np_version_under1p20: if op in [operator.floordiv, ops.rfloordiv]: - mark = pytest.mark.xfail(strict=False, reason="GH#38172") + mark = pytest.mark.xfail(reason="GH#38172") request.node.add_marker(mark) values = self._base([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) @@ -171,7 +171,7 @@ def test_float_same_index_with_nans( if not np_version_under1p20: if op in [operator.floordiv, ops.rfloordiv]: - mark = pytest.mark.xfail(strict=False, reason="GH#38172") + mark = pytest.mark.xfail(reason="GH#38172") request.node.add_marker(mark) values = self._base([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) diff --git a/pandas/tests/io/json/test_pandas.py b/pandas/tests/io/json/test_pandas.py index c3ada52eba5aa..8fc664104fdf1 100644 --- a/pandas/tests/io/json/test_pandas.py +++ b/pandas/tests/io/json/test_pandas.py @@ -1707,7 +1707,6 @@ def test_json_multiindex(self, dataframe, expected): @pytest.mark.xfail( is_platform_windows() and PY38, reason="localhost connection rejected", - strict=False, ) def test_to_s3(self, s3_resource, s3so): import time diff --git a/pandas/tests/io/parser/test_network.py b/pandas/tests/io/parser/test_network.py index 3727fe9484084..8ddb860597ddd 100644 --- a/pandas/tests/io/parser/test_network.py +++ b/pandas/tests/io/parser/test_network.py @@ -209,7 +209,7 @@ def test_read_s3_fails(self, s3so): with pytest.raises(IOError, match=msg): read_csv("s3://cant_get_it/file.csv") - @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) + @pytest.mark.xfail(reason="GH#39155 s3fs upgrade") def test_write_s3_csv_fails(self, tips_df, s3so): # GH 32486 # Attempting to write to an invalid S3 path should raise @@ -225,7 +225,7 @@ def test_write_s3_csv_fails(self, tips_df, s3so): "s3://an_s3_bucket_data_doesnt_exit/not_real.csv", storage_options=s3so ) - @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) + @pytest.mark.xfail(reason="GH#39155 s3fs upgrade") @td.skip_if_no("pyarrow") def test_write_s3_parquet_fails(self, tips_df, s3so): # GH 27679 diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 5adb3730a8c86..4162f4cee2bca 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -656,7 +656,6 @@ def test_categorical(self, pa): @pytest.mark.xfail( is_platform_windows() and PY38, reason="localhost connection rejected", - strict=False, ) def test_s3_roundtrip_explicit_fs(self, df_compat, s3_resource, pa, s3so): s3fs = pytest.importorskip("s3fs") diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index d25741a0a9fae..e1d2a32418da8 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -8,6 +8,7 @@ import numpy as np import pytest +from pandas.compat import is_platform_windows import pandas.util._test_decorators as td from pandas.core.dtypes.api import is_list_like @@ -482,13 +483,16 @@ def test_line_lim(self): assert xmin <= lines[0].get_data()[0][0] assert xmax >= lines[0].get_data()[0][-1] - @pytest.mark.xfail( - strict=False, - reason="2020-12-01 this has been failing periodically on the " - "ymin==0 assertion for a week or so.", - ) @pytest.mark.parametrize("stacked", [True, False]) - def test_area_lim(self, stacked): + def test_area_lim(self, stacked, request): + reason = ( + "2020-12-01 this has been failing periodically on the " + "ymin==0 assertion for a week or so." + ) + if is_platform_windows(): + mark = pytest.mark.xfail(reason=reason) + request.node.add_marker(mark) + df = DataFrame(np.random.rand(6, 4), columns=["x", "y", "z", "four"]) neg_df = -df diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index 4f332bfbac397..78c11a0fb9663 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -78,7 +78,6 @@ def test_registering_no_warning(self): @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") diff --git a/pandas/tests/plotting/test_groupby.py b/pandas/tests/plotting/test_groupby.py index f73ceee577a18..8d575cce73db4 100644 --- a/pandas/tests/plotting/test_groupby.py +++ b/pandas/tests/plotting/test_groupby.py @@ -19,7 +19,6 @@ 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 From 4a235ae414889500c62a7e806ad0e9a1757b7f9a Mon Sep 17 00:00:00 2001 From: Brock Date: Wed, 27 Jan 2021 10:13:37 -0800 Subject: [PATCH 2/8] un-xfail --- pandas/tests/io/parser/test_network.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/tests/io/parser/test_network.py b/pandas/tests/io/parser/test_network.py index 8ddb860597ddd..c22945e931f18 100644 --- a/pandas/tests/io/parser/test_network.py +++ b/pandas/tests/io/parser/test_network.py @@ -209,7 +209,6 @@ def test_read_s3_fails(self, s3so): with pytest.raises(IOError, match=msg): read_csv("s3://cant_get_it/file.csv") - @pytest.mark.xfail(reason="GH#39155 s3fs upgrade") def test_write_s3_csv_fails(self, tips_df, s3so): # GH 32486 # Attempting to write to an invalid S3 path should raise @@ -225,7 +224,6 @@ def test_write_s3_csv_fails(self, tips_df, s3so): "s3://an_s3_bucket_data_doesnt_exit/not_real.csv", storage_options=s3so ) - @pytest.mark.xfail(reason="GH#39155 s3fs upgrade") @td.skip_if_no("pyarrow") def test_write_s3_parquet_fails(self, tips_df, s3so): # GH 27679 From ef249cff7f9c59b7a8e96d2b101cab940806f315 Mon Sep 17 00:00:00 2001 From: Brock Date: Wed, 27 Jan 2021 10:43:17 -0800 Subject: [PATCH 3/8] fix xfailed sparse tests --- pandas/tests/arrays/sparse/test_arithmetics.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pandas/tests/arrays/sparse/test_arithmetics.py b/pandas/tests/arrays/sparse/test_arithmetics.py index f7376f8360199..86fbcb337b30e 100644 --- a/pandas/tests/arrays/sparse/test_arithmetics.py +++ b/pandas/tests/arrays/sparse/test_arithmetics.py @@ -124,8 +124,13 @@ def test_float_scalar( if not np_version_under1p20: if op in [operator.floordiv, ops.rfloordiv]: - mark = pytest.mark.xfail(reason="GH#38172") - request.node.add_marker(mark) + if op is operator.floordiv and scalar != 0: + pass + elif op is ops.rfloordiv and scalar == 0: + pass + else: + mark = pytest.mark.xfail(reason="GH#38172") + request.node.add_marker(mark) values = self._base([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) @@ -170,9 +175,10 @@ def test_float_same_index_with_nans( op = all_arithmetic_functions if not np_version_under1p20: - if op in [operator.floordiv, ops.rfloordiv]: - mark = pytest.mark.xfail(reason="GH#38172") - request.node.add_marker(mark) + if op is ops.rfloordiv: + if not (mix and kind == "block"): + mark = pytest.mark.xfail(reason="GH#38172") + request.node.add_marker(mark) values = self._base([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan]) rvalues = self._base([np.nan, 2, 3, 4, np.nan, 0, 1, 3, 2, np.nan]) From e543680f2ee6fe12f7e0a26a97d754bb412c5191 Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 28 Jan 2021 08:12:21 -0800 Subject: [PATCH 4/8] troubleshoot --- pandas/tests/io/parser/test_network.py | 2 ++ pandas/tests/io/test_parquet.py | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/parser/test_network.py b/pandas/tests/io/parser/test_network.py index c22945e931f18..0d333785fab92 100644 --- a/pandas/tests/io/parser/test_network.py +++ b/pandas/tests/io/parser/test_network.py @@ -8,6 +8,7 @@ import numpy as np import pytest +from pandas.compat import PY38 import pandas.util._test_decorators as td from pandas import DataFrame @@ -209,6 +210,7 @@ def test_read_s3_fails(self, s3so): with pytest.raises(IOError, match=msg): read_csv("s3://cant_get_it/file.csv") + @pytest.mark.xfail(not PY38, reason="GH#39155 s3fs upgrade") def test_write_s3_csv_fails(self, tips_df, s3so): # GH 32486 # Attempting to write to an invalid S3 path should raise diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 4162f4cee2bca..91d4ecb1a8fd5 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -9,7 +9,6 @@ import numpy as np import pytest -from pandas.compat import PY38, is_platform_windows import pandas.util._test_decorators as td import pandas as pd @@ -653,10 +652,6 @@ def test_categorical(self, pa): expected = df.astype(object) check_round_trip(df, pa, expected=expected) - @pytest.mark.xfail( - is_platform_windows() and PY38, - reason="localhost connection rejected", - ) def test_s3_roundtrip_explicit_fs(self, df_compat, s3_resource, pa, s3so): s3fs = pytest.importorskip("s3fs") if LooseVersion(pyarrow.__version__) <= LooseVersion("0.17.0"): From 183b51951cf21d39c3377f01997f0488979f121d Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 28 Jan 2021 13:50:46 -0800 Subject: [PATCH 5/8] punt --- pandas/tests/io/json/test_pandas.py | 1 + pandas/tests/io/parser/test_network.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/json/test_pandas.py b/pandas/tests/io/json/test_pandas.py index 8fc664104fdf1..c3ada52eba5aa 100644 --- a/pandas/tests/io/json/test_pandas.py +++ b/pandas/tests/io/json/test_pandas.py @@ -1707,6 +1707,7 @@ def test_json_multiindex(self, dataframe, expected): @pytest.mark.xfail( is_platform_windows() and PY38, reason="localhost connection rejected", + strict=False, ) def test_to_s3(self, s3_resource, s3so): import time diff --git a/pandas/tests/io/parser/test_network.py b/pandas/tests/io/parser/test_network.py index 0d333785fab92..3727fe9484084 100644 --- a/pandas/tests/io/parser/test_network.py +++ b/pandas/tests/io/parser/test_network.py @@ -8,7 +8,6 @@ import numpy as np import pytest -from pandas.compat import PY38 import pandas.util._test_decorators as td from pandas import DataFrame @@ -210,7 +209,7 @@ def test_read_s3_fails(self, s3so): with pytest.raises(IOError, match=msg): read_csv("s3://cant_get_it/file.csv") - @pytest.mark.xfail(not PY38, reason="GH#39155 s3fs upgrade") + @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) def test_write_s3_csv_fails(self, tips_df, s3so): # GH 32486 # Attempting to write to an invalid S3 path should raise @@ -226,6 +225,7 @@ def test_write_s3_csv_fails(self, tips_df, s3so): "s3://an_s3_bucket_data_doesnt_exit/not_real.csv", storage_options=s3so ) + @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) @td.skip_if_no("pyarrow") def test_write_s3_parquet_fails(self, tips_df, s3so): # GH 27679 From 12c1f33a97c7231a34070ad46dd3c6642a98c2d2 Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 28 Jan 2021 15:23:03 -0800 Subject: [PATCH 6/8] troubleshoot --- pandas/tests/plotting/frame/test_frame.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 22c9ec5d28730..60d43c6ee91c9 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -8,7 +8,6 @@ import numpy as np import pytest -from pandas.compat import is_platform_windows import pandas.util._test_decorators as td from pandas.core.dtypes.api import is_list_like @@ -483,15 +482,12 @@ def test_line_lim(self): assert xmin <= lines[0].get_data()[0][0] assert xmax >= lines[0].get_data()[0][-1] + @pytest.mark.xfail( + reason="2020-12-01 this has been failing periodically on the " + "ymin==0 assertion for a week or so.", + ) @pytest.mark.parametrize("stacked", [True, False]) def test_area_lim(self, stacked, request): - reason = ( - "2020-12-01 this has been failing periodically on the " - "ymin==0 assertion for a week or so." - ) - if is_platform_windows(): - mark = pytest.mark.xfail(reason=reason) - request.node.add_marker(mark) df = DataFrame(np.random.rand(6, 4), columns=["x", "y", "z", "four"]) From 7fb6b0690703c6f1f9d0cba200f50d2283d7e772 Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 28 Jan 2021 15:24:39 -0800 Subject: [PATCH 7/8] troubleshoot test_area_lim --- pandas/tests/plotting/frame/test_frame.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 60d43c6ee91c9..a5527bb6a9ada 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -8,6 +8,7 @@ import numpy as np import pytest +from pandas.compat import PY38, is_platform_windows import pandas.util._test_decorators as td from pandas.core.dtypes.api import is_list_like @@ -483,6 +484,7 @@ def test_line_lim(self): assert xmax >= lines[0].get_data()[0][-1] @pytest.mark.xfail( + is_platform_windows() or not PY38, reason="2020-12-01 this has been failing periodically on the " "ymin==0 assertion for a week or so.", ) From 691808fbc30294faabfcb83e3127a9628a2be2af Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 30 Jan 2021 14:38:45 -0800 Subject: [PATCH 8/8] revert --- pandas/tests/io/test_parquet.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 91d4ecb1a8fd5..5adb3730a8c86 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -9,6 +9,7 @@ import numpy as np import pytest +from pandas.compat import PY38, is_platform_windows import pandas.util._test_decorators as td import pandas as pd @@ -652,6 +653,11 @@ def test_categorical(self, pa): expected = df.astype(object) check_round_trip(df, pa, expected=expected) + @pytest.mark.xfail( + is_platform_windows() and PY38, + reason="localhost connection rejected", + strict=False, + ) def test_s3_roundtrip_explicit_fs(self, df_compat, s3_resource, pa, s3so): s3fs = pytest.importorskip("s3fs") if LooseVersion(pyarrow.__version__) <= LooseVersion("0.17.0"):