Skip to content

TST: stricter xfails, catch/suppress warnings #33882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
May 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
67ab32f
TST: fix xfailed arithmetic tests
jbrockmendel Apr 28, 2020
ae3837c
TST: strictify xfails
jbrockmendel Apr 28, 2020
63cbaa9
strictify
jbrockmendel Apr 28, 2020
5338c37
strictify xfail
jbrockmendel Apr 28, 2020
5ba2112
stricter
jbrockmendel Apr 28, 2020
13d93bf
fix xfail
jbrockmendel Apr 28, 2020
a8328bc
tighten
jbrockmendel Apr 28, 2020
7ed3c67
take it all back
jbrockmendel Apr 28, 2020
3f4fcbf
tighten tests
jbrockmendel Apr 28, 2020
45b3cbb
CI: Skip permissions test when running as sudo (#33847)
TomAugspurger Apr 28, 2020
1ce5589
troubleshoot
jbrockmendel Apr 28, 2020
3fe8ab3
TST: stop skipping Categorical take tests (#33859)
jbrockmendel Apr 29, 2020
a2d025e
Fix typo (#33861)
taljaards Apr 29, 2020
82e2463
REF/CLN: Parametrize _isna (#33835)
dsaxton Apr 29, 2020
306044b
DOC: Code Standards Broken Link (#33865)
simonjayhawkins Apr 29, 2020
c6845da
TYP/CLN: remove #type: ignore from pandas\tests\base\test_conversion.…
simonjayhawkins Apr 29, 2020
f898f4b
CLN: address FIXME/TODO/XXX comments (#33858)
jbrockmendel Apr 29, 2020
ef09e64
DOC: Remove TODO from `test_openpyxl` (#33872)
charlesdong1991 Apr 29, 2020
3a56433
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 29, 2020
7451dbc
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 29, 2020
7bf479b
remove box_df_fail
jbrockmendel Apr 29, 2020
6863882
TST: cactch/suppress warnings
jbrockmendel Apr 29, 2020
32666d9
TST: catch/suppress warnings
jbrockmendel Apr 29, 2020
f27775c
TST: dynamic xfails
jbrockmendel Apr 29, 2020
72096cf
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 29, 2020
67e8731
troubleshoot CI
jbrockmendel Apr 30, 2020
5ab07c5
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 30, 2020
650aed3
un-silence
jbrockmendel Apr 30, 2020
954994d
troubleshoot CI
jbrockmendel Apr 30, 2020
33d2aab
troubleshoot CI
jbrockmendel Apr 30, 2020
8641843
revert
jbrockmendel Apr 30, 2020
930a421
troubleshoot interval
jbrockmendel Apr 30, 2020
be3a449
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel May 1, 2020
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
16 changes: 0 additions & 16 deletions pandas/tests/arithmetic/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,6 @@ def box(request):
return request.param


@pytest.fixture(
params=[
pd.Index,
pd.Series,
pytest.param(pd.DataFrame, marks=pytest.mark.xfail),
tm.to_array,
],
ids=id_func,
)
def box_df_fail(request):
"""
Fixture equivalent to `box` fixture but xfailing the DataFrame case.
"""
return request.param


@pytest.fixture(params=[pd.Index, pd.Series, pd.DataFrame, tm.to_array], ids=id_func)
def box_with_array(request):
"""
Expand Down
17 changes: 11 additions & 6 deletions pandas/tests/arithmetic/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ def test_compare_scalar_interval_mixed_closed(self, op, closed, other_closed):
expected = self.elementwise_comparison(op, array, other)
tm.assert_numpy_array_equal(result, expected)

def test_compare_scalar_na(self, op, array, nulls_fixture):
def test_compare_scalar_na(self, op, array, nulls_fixture, request):
result = op(array, nulls_fixture)
expected = self.elementwise_comparison(op, array, nulls_fixture)

if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int"):
pytest.xfail("broken for non-integer IntervalArray; see GH 31882")
if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int64"):
mark = pytest.mark.xfail(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a helpful function for this if we are going to do across the codebase? Jeff's idea - here

I'm happy to tackle some myself too :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it. I think this is a strictly better pattern than pytest.xfail, since it will alert us if an xfail becomes fixed.

reason="broken for non-integer IntervalArray; see GH 31882"
)
request.node.add_marker(mark)

tm.assert_numpy_array_equal(result, expected)

Expand Down Expand Up @@ -207,13 +210,15 @@ def test_compare_list_like_object(self, op, array, other):
expected = self.elementwise_comparison(op, array, other)
tm.assert_numpy_array_equal(result, expected)

def test_compare_list_like_nan(self, op, array, nulls_fixture):
def test_compare_list_like_nan(self, op, array, nulls_fixture, request):
other = [nulls_fixture] * 4
result = op(array, other)
expected = self.elementwise_comparison(op, array, other)

if nulls_fixture is pd.NA:
pytest.xfail("broken for non-integer IntervalArray; see GH 31882")
if nulls_fixture is pd.NA and array.dtype.subtype != "i8":
reason = "broken for non-integer IntervalArray; see GH 31882"
mark = pytest.mark.xfail(reason=reason)
request.node.add_marker(mark)

tm.assert_numpy_array_equal(result, expected)

Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/indexes/test_index_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_constructor_infer_periodindex(self):
],
)
def test_constructor_infer_nat_dt_like(
self, pos, klass, dtype, ctor, nulls_fixture
self, pos, klass, dtype, ctor, nulls_fixture, request
):
expected = klass([NaT, NaT])
assert expected.dtype == dtype
Expand All @@ -92,7 +92,8 @@ def test_constructor_infer_nat_dt_like(

if nulls_fixture is NA:
expected = Index([NA, NaT])
pytest.xfail("Broken with np.NaT ctor; see GH 31884")
mark = pytest.mark.xfail(reason="Broken with np.NaT ctor; see GH 31884")
request.node.add_marker(mark)

result = Index(data)
tm.assert_index_equal(result, expected)
Expand Down
5 changes: 5 additions & 0 deletions pandas/tests/io/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ def test_read_expands_user_home_dir(
),
],
)
@pytest.mark.filterwarnings(
"ignore:This method will be removed in future versions. "
r"Use 'tree.iter\(\)' or 'list\(tree.iter\(\)\)' instead."
":PendingDeprecationWarning"
)
def test_read_fspath_all(self, reader, module, path, datapath):
pytest.importorskip(module)
path = datapath(*path)
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,9 @@ def test_add_matplotlib_datetime64(self):
# ax.xaxis.converter with a DatetimeConverter
s = Series(np.random.randn(10), index=date_range("1970-01-02", periods=10))
ax = s.plot()
ax.plot(s.index, s.values, color="g")
with tm.assert_produces_warning(DeprecationWarning):
# multi-dimensional indexing
ax.plot(s.index, s.values, color="g")
l1, l2 = ax.lines
tm.assert_numpy_array_equal(l1.get_xydata(), l2.get_xydata())

Expand Down