Skip to content

Commit

Permalink
add xfail to some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EdAbati committed Sep 8, 2024
1 parent 2b114eb commit 378b421
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
4 changes: 3 additions & 1 deletion tests/frame/clone_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
from tests.utils import compare_dicts


def test_clone(request: Any, constructor: Any) -> None:
def test_clone(request: pytest.FixtureRequest, constructor: Any) -> None:
if "dask" in str(constructor):
request.applymarker(pytest.mark.xfail)
if "pyarrow_table" in str(constructor):
request.applymarker(pytest.mark.xfail)
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)

expected = {"a": [1, 2], "b": [3, 4]}
df = nw.from_native(constructor(expected))
Expand Down
10 changes: 8 additions & 2 deletions tests/frame/concat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from tests.utils import compare_dicts


def test_concat_horizontal(constructor: Any) -> None:
def test_concat_horizontal(request: pytest.FixtureRequest, constructor: Any) -> None:
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)

data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8, 9]}
df_left = nw.from_native(constructor(data)).lazy()

Expand All @@ -27,7 +30,10 @@ def test_concat_horizontal(constructor: Any) -> None:
nw.concat([])


def test_concat_vertical(constructor: Any) -> None:
def test_concat_vertical(request: pytest.FixtureRequest, constructor: Any) -> None:
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)

data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8, 9]}
df_left = (
nw.from_native(constructor(data)).lazy().rename({"a": "c", "b": "d"}).drop("z")
Expand Down
10 changes: 8 additions & 2 deletions tests/frame/drop_nulls_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
}


def test_drop_nulls(constructor: Any) -> None:
def test_drop_nulls(request: pytest.FixtureRequest, constructor: Any) -> None:
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
result = nw.from_native(constructor(data)).drop_nulls()
expected = {
"a": [2.0, 4.0],
Expand All @@ -23,7 +25,11 @@ def test_drop_nulls(constructor: Any) -> None:


@pytest.mark.parametrize("subset", ["a", ["a"]])
def test_drop_nulls_subset(constructor: Any, subset: str | list[str]) -> None:
def test_drop_nulls_subset(
request: pytest.FixtureRequest, constructor: Any, subset: str | list[str]
) -> None:
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
result = nw.from_native(constructor(data)).drop_nulls(subset=subset)
expected = {
"a": [1, 2.0, 4.0],
Expand Down
18 changes: 16 additions & 2 deletions tests/frame/drop_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
(["abc", "b"], ["z"]),
],
)
def test_drop(constructor: Any, to_drop: list[str], expected: list[str]) -> None:
def test_drop(
request: pytest.FixtureRequest,
constructor: Any,
to_drop: list[str],
expected: list[str],
) -> None:
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)
data = {"abc": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8, 9]}
df = nw.from_native(constructor(data))
assert df.drop(to_drop).collect_schema().names() == expected
Expand All @@ -38,13 +45,20 @@ def test_drop(constructor: Any, to_drop: list[str], expected: list[str]) -> None
(False, does_not_raise()),
],
)
def test_drop_strict(request: Any, constructor: Any, strict: bool, context: Any) -> None: # noqa: FBT001
def test_drop_strict(
request: pytest.FixtureRequest,
constructor: Any,
strict: bool, # noqa: FBT001
context: Any,
) -> None:
if (
"polars_lazy" in str(request)
and parse_version(pl.__version__) < (1, 0, 0)
and strict
):
request.applymarker(pytest.mark.xfail)
if "pyspark" in str(constructor):
request.applymarker(pytest.mark.xfail)

data = {"a": [1, 3, 2], "b": [4, 4, 6]}
to_drop = ["a", "z"]
Expand Down

0 comments on commit 378b421

Please sign in to comment.