Skip to content

Commit

Permalink
Use pytest param instead of request.applymarker
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Jul 31, 2024
1 parent 72de8a6 commit 658958a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions python/cudf/cudf/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2496,20 +2496,28 @@ def test_dti_asi8():
"method, kwargs",
[
["mean", {}],
["std", {}],
["std", {"ddof": 0}],
pytest.param(
"std",
{},
marks=pytest.mark.xfail(
reason="https://github.com/rapidsai/cudf/issues/16444"
),
),
pytest.param(
"std",
{"ddof": 0},
marks=pytest.mark.xfail(
reason="https://github.com/rapidsai/cudf/issues/16444"
),
),
],
)
def test_dti_reduction(method, kwargs, request):
def test_dti_reduction(method, kwargs):
pd_dti = pd.DatetimeIndex(["2020-01-01", "2020-12-31"], name="foo")
cudf_dti = cudf.from_pandas(pd_dti)

result = getattr(cudf_dti, method)(**kwargs)
expected = getattr(pd_dti, method)(**kwargs)
if method == "std":
request.applymarker(
pytest.mark.xfail(reason="cudf returns imprecise nanoseconds")
)
assert result == expected


Expand Down

0 comments on commit 658958a

Please sign in to comment.