Skip to content
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

TST: strict xfail #38960

Merged
merged 6 commits into from
Jan 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def index_with_missing(request):
Fixture for indices with missing values
"""
if request.param in ["int", "uint", "range", "empty", "repeats"]:
pytest.xfail("missing values not supported")
pytest.skip("missing values not supported")
# GH 35538. Use deep copy to avoid illusive bug on np-dev
# Azure pipeline that writes into indices_dict despite copy
ind = indices_dict[request.param].copy(deep=True)
Expand Down
2 changes: 0 additions & 2 deletions pandas/tests/indexing/test_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ def test_insert_index_datetimes(self, fill_val, exp_dtype):
with pytest.raises(TypeError, match=msg):
obj.insert(1, 1)

pytest.xfail("ToDo: must coerce to object")
Copy link
Member

Choose a reason for hiding this comment

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

i think this indicates something that we need to fix. maybe should write out the assertion so that the xfail is meaningful

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @jbrockmendel, I was planning on pinging you and @WillAyd after a bit more digging into this, but you beat me to it :). This was originally changed in #18721 from a comment to the xfail that exists now. The comments were originally added
in 7c0b742. I'm not sure what should be asserted here; from the history it seems like it refers to the tests above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also note those comments still exist in the test immediately below.

Copy link
Member

Choose a reason for hiding this comment

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

if we want to coerce to object (and i think we do), then for starters the insert on L467 shouldn't raise but should instead be equivalent to obj.astype(object).insert(1, 1). so i think can just change that and then xfail it?

the harder question is what we do in the two cases above that with mismatched tz or mismatched tzawareness. with mismatched tz could just cast (#37605), with mismatched tzawareness could also cast to object.

Copy link
Contributor

Choose a reason for hiding this comment

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

if you can create an issue for this in followup (and PR if you can!)


def test_insert_index_timedelta64(self):
obj = pd.TimedeltaIndex(["1 day", "2 day", "3 day", "4 day"])
assert obj.dtype == "timedelta64[ns]"
Expand Down
6 changes: 4 additions & 2 deletions pandas/tests/tseries/offsets/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ def _get_offset(self, klass, value=1, normalize=False):
klass = klass(value, normalize=normalize)
return klass

def test_apply_out_of_range(self, tz_naive_fixture):
def test_apply_out_of_range(self, request, tz_naive_fixture):
tz = tz_naive_fixture
if self._offset is None:
return
if isinstance(tz, tzlocal) and not IS64:
pytest.xfail(reason="OverflowError inside tzlocal past 2038")
request.node.add_marker(
pytest.mark.xfail(reason="OverflowError inside tzlocal past 2038")
)

# try to create an out-of-bounds result timestamp; if we can't create
# the offset skip
Expand Down