Skip to content

TST: un-xfail NaT test on npdev #51455

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 3 commits into from
Feb 17, 2023
Merged
Changes from all commits
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
24 changes: 11 additions & 13 deletions pandas/tests/scalar/test_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytz

from pandas._libs.tslibs import iNaT
from pandas.compat import is_numpy_dev

from pandas.core.dtypes.common import is_datetime64_any_dtype

Expand Down Expand Up @@ -524,27 +525,24 @@ def test_to_numpy_alias():
[
Timedelta(0),
Timedelta(0).to_pytimedelta(),
pytest.param(
Timedelta(0).to_timedelta64(),
marks=pytest.mark.xfail(
reason="td64 doesn't return NotImplemented, see numpy#17017"
),
),
Timedelta(0).to_timedelta64(),
Timestamp(0),
Timestamp(0).to_pydatetime(),
pytest.param(
Timestamp(0).to_datetime64(),
marks=pytest.mark.xfail(
reason="dt64 doesn't return NotImplemented, see numpy#17017"
),
),
Timestamp(0).to_datetime64(),
Timestamp(0).tz_localize("UTC"),
NaT,
],
)
def test_nat_comparisons(compare_operators_no_eq_ne, other):
def test_nat_comparisons(compare_operators_no_eq_ne, other, request):
# GH 26039
opname = compare_operators_no_eq_ne
if isinstance(other, (np.datetime64, np.timedelta64)) and (
opname in ["__eq__", "__ne__"] or not is_numpy_dev
Copy link
Member Author

Choose a reason for hiding this comment

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

looks like the eq/ne checks here are unnecessary. ill clean it up in a follow-up so we can get the CI back to green quickly.

):
mark = pytest.mark.xfail(
reason="dt64/td64 don't return NotImplemented, see numpy#17017",
)
request.node.add_marker(mark)

assert getattr(NaT, opname)(other) is False

Expand Down