Skip to content

Commit dcb4a8a

Browse files
author
dcreekp
committed
TST: clean up to change setup.cfg to xfail_strict = True (GH23057)
1 parent 8af7637 commit dcb4a8a

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

pandas/tests/indexing/test_coercion.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -901,18 +901,14 @@ def test_replace_series_datetime_tz(self):
901901

902902
tm.assert_series_equal(result, exp)
903903

904-
# TODO(jreback) commented out to only have a single xfail printed
905-
@pytest.mark.xfail(reason="different tz, "
906-
"currently mask_missing raises SystemError")
907-
# @pytest.mark.parametrize('how', ['dict', 'series'])
908-
# @pytest.mark.parametrize('to_key', [
909-
# 'datetime64[ns]', 'datetime64[ns, UTC]',
910-
# 'datetime64[ns, US/Eastern]'])
911-
# @pytest.mark.parametrize('from_key', [
912-
# 'datetime64[ns]', 'datetime64[ns, UTC]',
913-
# 'datetime64[ns, US/Eastern]'])
914-
# def test_replace_series_datetime_datetime(self, how, to_key, from_key):
915-
def test_replace_series_datetime_datetime(self):
904+
@pytest.mark.parametrize('how', ['dict', 'series'])
905+
@pytest.mark.parametrize('to_key', [
906+
'datetime64[ns]', 'datetime64[ns, UTC]',
907+
'datetime64[ns, US/Eastern]'])
908+
@pytest.mark.parametrize('from_key', [
909+
'datetime64[ns]', 'datetime64[ns, UTC]',
910+
'datetime64[ns, US/Eastern]'])
911+
def test_replace_series_datetime_datetime(self, how, to_key, from_key):
916912
how = 'dict'
917913
to_key = 'datetime64[ns]'
918914
from_key = 'datetime64[ns]'

pandas/tests/io/test_parquet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ def test_basic(self, pa, df_full):
404404
check_round_trip(df, pa)
405405

406406
# TODO: This doesn't fail on all systems; track down which
407-
@pytest.mark.xfail(reason="pyarrow fails on this (ARROW-1883)")
407+
@pytest.mark.xfail(reason="pyarrow fails on this (ARROW-1883)",
408+
strict=False)
408409
def test_basic_subset_columns(self, pa, df_full):
409410
# GH18628
410411

@@ -422,7 +423,6 @@ def test_duplicate_columns(self, pa):
422423
columns=list('aaa')).copy()
423424
self.check_error_on_write(df, pa, ValueError)
424425

425-
@pytest.mark.xfail(reason="failing for pyarrow < 0.11.0")
426426
def test_unsupported(self, pa):
427427
# period
428428
df = pd.DataFrame({'a': pd.period_range('2013', freq='M', periods=3)})

pandas/tests/plotting/test_datetimelike.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,8 @@ def test_irreg_dtypes(self):
10751075
_, ax = self.plt.subplots()
10761076
_check_plot_works(df.plot, ax=ax)
10771077

1078-
@pytest.mark.xfail(not PY3, reason="failing on mpl 1.4.3 on PY2")
1078+
@pytest.mark.xfail(not PY3, reason="failing on mpl 1.4.3 on PY2",
1079+
strict=False)
10791080
@pytest.mark.slow
10801081
def test_time(self):
10811082
t = datetime(1, 1, 1, 3, 30, 0)

pandas/tests/plotting/test_frame.py

+1
Original file line numberDiff line numberDiff line change
@@ -2558,6 +2558,7 @@ def test_errorbar_asymmetrical(self):
25582558

25592559
tm.close()
25602560

2561+
# This XPASSES when tested with mpl == 3.0.1
25612562
@td.xfail_if_mpl_2_2
25622563
def test_table(self):
25632564
df = DataFrame(np.random.rand(10, 3),

pandas/tests/plotting/test_misc.py

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def test_bootstrap_plot(self):
6161
@td.skip_if_no_mpl
6262
class TestDataFramePlots(TestPlotBase):
6363

64+
# This XPASSES when tested with mpl == 3.0.1
6465
@td.xfail_if_mpl_2_2
6566
@td.skip_if_no_scipy
6667
def test_scatter_matrix_axis(self):

pandas/tests/plotting/test_series.py

+1
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ def test_errorbar_plot(self):
771771
with pytest.raises((ValueError, TypeError)):
772772
s.plot(yerr=s_err)
773773

774+
# This XPASSES when tested with mpl == 3.0.1
774775
@td.xfail_if_mpl_2_2
775776
def test_table(self):
776777
_check_plot_works(self.series.plot, table=True)

pandas/tests/scalar/period/test_period.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,8 @@ def test_period_immutable():
14541454

14551455

14561456
# TODO: This doesn't fail on all systems; track down which
1457-
@pytest.mark.xfail(reason="Parses as Jan 1, 0007 on some systems")
1457+
@pytest.mark.xfail(reason="Parses as Jan 1, 0007 on some systems",
1458+
strict=False)
14581459
def test_small_year_parsing():
14591460
per1 = Period('0001-01-07', 'D')
14601461
assert per1.year == 1

pandas/util/_test_decorators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def decorated_func(func):
158158
skip_if_mpl = pytest.mark.skipif(not _skip_if_no_mpl(),
159159
reason="matplotlib is present")
160160
xfail_if_mpl_2_2 = pytest.mark.xfail(_skip_if_mpl_2_2(),
161-
reason="matplotlib 2.2")
161+
reason="matplotlib 2.2",
162+
strict=False)
162163
skip_if_32bit = pytest.mark.skipif(is_platform_32bit(),
163164
reason="skipping for 32 bit")
164165
skip_if_windows = pytest.mark.skipif(is_platform_windows(),

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ markers =
6767
clipboard: mark a pd.read_clipboard test
6868
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
6969
addopts = --strict-data-files
70+
xfail_strict = True
7071

7172
[coverage:run]
7273
branch = False

0 commit comments

Comments
 (0)