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

Set strict xfail option #5220

Merged
merged 12 commits into from Aug 16, 2019
1 change: 0 additions & 1 deletion dask/array/tests/test_array_core.py
Expand Up @@ -240,7 +240,6 @@ def test_Array_computation():
LooseVersion(np.__version__) < "1.14.0",
reason="NumPy doesn't have `np.linalg._umath_linalg` yet",
)
@pytest.mark.xfail(reason="Protect from `np.linalg._umath_linalg.inv` breaking")
def test_Array_numpy_gufunc_call__array_ufunc__01():
x = da.random.normal(size=(3, 10, 10), chunks=(2, 10, 10))
nx = x.compute()
Expand Down
3 changes: 0 additions & 3 deletions dask/array/tests/test_array_function.py
Expand Up @@ -89,9 +89,6 @@ def test_array_function_sparse(func):


@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
@pytest.mark.xfail(
reason="requires sparse support for __array_function__", strict=False
)
def test_array_function_sparse_tensordot():
sparse = pytest.importorskip("sparse")
x = np.random.random((2, 3, 4))
Expand Down
8 changes: 1 addition & 7 deletions dask/array/tests/test_array_utils.py
Expand Up @@ -3,19 +3,13 @@

import dask.array as da
from dask.array.utils import meta_from_array, assert_eq
from dask.array.numpy_compat import _numpy_117

asarrays = [np.asarray]

try:
import sparse

asarrays.append(
pytest.param(
sparse.COO.from_numpy,
marks=pytest.mark.xfail(_numpy_117, reason="sparse-257"),
)
)
asarrays.append(sparse.COO.from_numpy)
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion dask/array/tests/test_creation.py
Expand Up @@ -600,7 +600,7 @@ def test_tile_array_reps(shape, chunks, reps):
da.tile(d, reps)


skip_stat_length = pytest.mark.xfail(_numpy_117, reason="numpy-14061", strict=True)
skip_stat_length = pytest.mark.xfail(_numpy_117, reason="numpy-14061")


@pytest.mark.parametrize(
Expand Down
3 changes: 0 additions & 3 deletions dask/array/tests/test_gufunc.py
Expand Up @@ -166,9 +166,6 @@ def foo(x, bar):
assert_eq(ret, np.array(1.0, dtype="f"))


@pytest.mark.xfail(
reason="Currently np.einsum doesn't seem to broadcast correctly for this case"
)
def test_apply_gufunc_02():
def outer_product(x, y):
return np.einsum("...i,...j->...ij", x, y)
Expand Down
2 changes: 1 addition & 1 deletion dask/bytes/tests/test_http.py
Expand Up @@ -166,7 +166,7 @@ def test_parquet():
assert df.columns.tolist() == ["n_nationkey", "n_name", "n_regionkey", "n_comment"]


@pytest.mark.xfail(reason="https://github.com/dask/dask/issues/3696")
@pytest.mark.xfail(reason="https://github.com/dask/dask/issues/3696", strict=False)
@pytest.mark.network
def test_bag():
# This test pulls from different hosts
Expand Down
7 changes: 3 additions & 4 deletions dask/dataframe/io/tests/test_io.py
Expand Up @@ -268,13 +268,12 @@ def test_from_pandas_small():
assert_eq(s, ds)


@pytest.mark.xfail(reason="")
def test_from_pandas_npartitions_is_accurate():
@pytest.mark.parametrize("n", [1, 2, 4, 5])
def test_from_pandas_npartitions_is_accurate(n):
df = pd.DataFrame(
{"x": [1, 2, 3, 4, 5, 6], "y": list("abdabd")}, index=[10, 20, 30, 40, 50, 60]
)
for n in [1, 2, 4, 5]:
assert dd.from_pandas(df, npartitions=n).npartitions == n
assert dd.from_pandas(df, npartitions=n).npartitions <= n


def test_from_pandas_series():
Expand Down
2 changes: 1 addition & 1 deletion dask/dataframe/tests/test_accessors.py
Expand Up @@ -241,4 +241,4 @@ def test_str_accessor_expand_more_columns():
s = pd.Series(["a b c", "aa bb cc", "aaa bbb ccc"])
ds = dd.from_pandas(s, npartitions=2)

s.str.split(n=10, expand=True).compute()
ds.str.split(n=10, expand=True).compute()
23 changes: 4 additions & 19 deletions dask/dataframe/tests/test_dataframe.py
Expand Up @@ -27,13 +27,7 @@
total_mem_usage,
)
from dask.dataframe import methods
from dask.dataframe.utils import (
assert_eq,
make_meta,
assert_max_deps,
PANDAS_VERSION,
PANDAS_GT_0250,
)
from dask.dataframe.utils import assert_eq, make_meta, assert_max_deps, PANDAS_VERSION

dsk = {
("x", 0): pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}, index=[0, 1, 3]),
Expand Down Expand Up @@ -403,7 +397,6 @@ def test_describe(include, exclude, percentiles, subset):
)


@pytest.mark.xfail(PANDAS_GT_0250, reason="Pandas change.")
def test_describe_empty():
df_none = pd.DataFrame({"A": [None, None]})
ddf_none = dd.from_pandas(df_none, 2)
Expand All @@ -413,16 +406,9 @@ def test_describe_empty():

# Pandas have different dtypes for resulting describe dataframe if there are only
# None-values, pre-compute dask df to bypass _meta check
if PANDAS_GT_0250:
# https://github.com/pandas-dev/pandas/issues/27183
# may be fixed for pandas RC. If so, remove
expected = df_none.describe()
result = ddf_none.describe(percentiles_method="dask").compute()
assert_eq(expected, result)
else:
assert_eq(
df_none.describe(), ddf_none.describe(percentiles_method="dask").compute()
)
assert_eq(
df_none.describe(), ddf_none.describe(percentiles_method="dask").compute()
)

with pytest.raises(ValueError):
ddf_len0.describe(percentiles_method="dask").compute()
Expand All @@ -434,7 +420,6 @@ def test_describe_empty():
ddf_nocols.describe(percentiles_method="dask").compute()


@pytest.mark.xfail(PANDAS_GT_0250, reason="Pandas change.")
def test_describe_empty_tdigest():
pytest.importorskip("crick")

Expand Down
4 changes: 1 addition & 3 deletions dask/dataframe/tests/test_ufunc.py
Expand Up @@ -10,7 +10,6 @@
import dask.array as da
import dask.dataframe as dd
from dask.dataframe.utils import assert_eq
from dask.array.numpy_compat import _numpy_117


_BASE_UFUNCS = [
Expand Down Expand Up @@ -155,8 +154,7 @@ def test_ufunc(pandas_input, ufunc):
pytest.param("imag", marks=pytest.mark.filterwarnings("ignore::FutureWarning")),
"angle",
"fix",
# Possible NumPy / pandas bug: https://github.com/numpy/numpy/issues/13894
pytest.param("i0", marks=pytest.mark.xfail(_numpy_117, reason="NumPy-13894")),
"i0",
"sinc",
"nan_to_num",
],
Expand Down
16 changes: 14 additions & 2 deletions dask/tests/test_distributed.py
Expand Up @@ -121,8 +121,20 @@ def test_to_hdf_distributed(loop):
test_to_hdf()


@pytest.mark.xfail(reason="HDF not multi-process safe")
@pytest.mark.parametrize("npartitions", [1, 4, 10])
@pytest.mark.parametrize(
"npartitions",
[
1,
pytest.param(
4,
marks=pytest.mark.xfail(reason="HDF not multi-process safe", strict=False),
),
pytest.param(
10,
marks=pytest.mark.xfail(reason="HDF not multi-process safe", strict=False),
),
],
)
def test_to_hdf_scheduler_distributed(npartitions, loop):
from ..dataframe.io.tests.test_hdf import test_to_hdf_schedulers

Expand Down
8 changes: 6 additions & 2 deletions dask/tests/test_dot.py
Expand Up @@ -128,7 +128,9 @@ def test_aliases():
pytest.param(
"jpeg",
Image,
marks=pytest.mark.xfail(reason="jpeg not always supported in dot"),
marks=pytest.mark.xfail(
reason="jpeg not always supported in dot", strict=False
),
),
("dot", type(None)),
("pdf", type(None)),
Expand Down Expand Up @@ -159,7 +161,9 @@ def test_dot_graph(tmpdir, format, typ):
pytest.param(
"jpeg",
Image,
marks=pytest.mark.xfail(reason="jpeg not always supported in dot"),
marks=pytest.mark.xfail(
reason="jpeg not always supported in dot", strict=False
),
),
("dot", type(None)),
("pdf", type(None)),
Expand Down
3 changes: 1 addition & 2 deletions dask/tests/test_order.py
Expand Up @@ -36,7 +36,6 @@ def test_ordering_keeps_groups_together(abcde):
assert abs(o[(a, 1)] - o[(a, 3)]) == 1


@pytest.mark.xfail(reason="Can't please 'em all")
def test_avoid_broker_nodes(abcde):
r"""

Expand Down Expand Up @@ -173,7 +172,7 @@ def test_avoid_upwards_branching_complex(abcde):
assert o[(c, 1)] < o[(b, 1)]


@pytest.mark.xfail(reason="this case is ambiguous")
@pytest.mark.xfail(reason="this case is ambiguous", strict=False)
jrbourbeau marked this conversation as resolved.
Show resolved Hide resolved
def test_deep_bases_win_over_dependents(abcde):
r"""
It's not clear who should run first, e or d
Expand Down
1 change: 1 addition & 0 deletions dask/tests/test_threaded.py
Expand Up @@ -138,6 +138,7 @@ def test_f():
@pytest.mark.xfail(
"xdist" in sys.modules,
reason="This test fails intermittently when using pytest-xdist (maybe)",
strict=False,
)
def test_interrupt():
# Python 2 and windows 2 & 3 both implement `queue.get` using polling,
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Expand Up @@ -43,6 +43,7 @@ filterwarnings =
error:::pandas[.*]
error:::numpy[.*]
error:::distributed[.*]]
xfail_strict=true

[metadata]
license_files = LICENSE.txt