-
Notifications
You must be signed in to change notification settings - Fork 2
/
conftest.py
93 lines (79 loc) · 3.89 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import re
from typing import Union
import pytest
from hypothesis import settings
from .wrappers import libinfo_params
# TODO: apply deadline=None only to modin test cases
settings.register_profile("no_deadline", deadline=None)
settings.load_profile("no_deadline")
def pytest_generate_tests(metafunc):
if "libinfo" in metafunc.fixturenames:
metafunc.parametrize("libinfo", libinfo_params)
def pytest_addoption(parser):
parser.addoption(
"--ci",
action="store_true",
help="xfail and skip relevant tests for ../.github/workflows/test.yml",
)
# See https://github.com/HypothesisWorks/hypothesis/issues/2434
parser.addoption(
"--max-examples",
action="store",
default=None,
help="set max examples generated by Hypothesis",
)
def pytest_configure(config):
max_examples: Union[None, str] = config.getoption("--max-examples")
if max_examples is not None:
settings.register_profile("max_examples", max_examples=int(max_examples))
settings.load_profile("max_examples")
ci_xfail_ids = [
# https://github.com/vaexio/vaex/issues/2083
"test_from_dataframe.py::test_from_dataframe_roundtrip[vaex-pandas]",
# TODO: triage
"test_from_dataframe.py::test_from_dataframe_roundtrip[vaex-polars]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[polars-vaex]",
# https://github.com/data-apis/dataframe-interchange-tests/pull/21#issuecomment-1495914398
"test_from_dataframe.py::test_from_dataframe_roundtrip[pyarrow.Table-vaex]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[vaex-pyarrow.Table]",
# https://github.com/apache/arrow/issues/35713
"test_from_dataframe.py::test_from_dataframe_roundtrip[polars-pyarrow.Table]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[pyarrow.Table-polars]",
# https://github.com/rapidsai/cudf/issues/11389
"test_column_object.py::test_dtype[cudf]",
# https://github.com/modin-project/modin/issues/4687
"test_column_object.py::test_null_count[modin]",
# https://github.com/vaexio/vaex/issues/2121
"test_column_object.py::test_get_chunks[vaex]",
]
ci_skip_ids = [
# https://github.com/rapidsai/cudf/issues/11332
"test_column_object.py::test_describe_categorical[cudf]",
"test_column_object.py::test_describe_categorical_on_categorical[cudf]",
# https://github.com/vaexio/vaex/issues/2118
# https://github.com/vaexio/vaex/issues/2139
"test_column_object.py::test_dtype[vaex]",
# SEGFAULT
"test_from_dataframe.py::test_from_dataframe_roundtrip[pandas-vaex]",
# modin flakiness - probably from monkeypatching done in wrappers.py
"test_from_dataframe.py::test_from_dataframe_roundtrip[pandas-modin]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[modin-pandas]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[modin-modin]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[modin-vaex]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[modin-polars]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[vaex-modin]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[modin-pyarrow.Table]",
"test_from_dataframe.py::test_from_dataframe_roundtrip[pyarrow.Table-modin]",
"test_meta.py::test_frame_equal[modin]",
]
assert not any(case in ci_xfail_ids for case in ci_skip_ids) # sanity check
r_cudf_roundtrip = re.compile(r"test_from_dataframe_roundtrip\[.*cudf.*\]")
def pytest_collection_modifyitems(config, items):
if config.getoption("--ci"):
for item in items:
if any(id_ in item.nodeid for id_ in ci_xfail_ids):
item.add_marker(pytest.mark.xfail(strict=True))
elif any(id_ in item.nodeid for id_ in ci_skip_ids):
item.add_marker(pytest.mark.skip("flaky"))
elif r_cudf_roundtrip.search(item.nodeid):
item.add_marker(pytest.mark.skip("crashes pytest"))