Skip to content

Commit

Permalink
Temporarily xfail two tests (#145)
Browse files Browse the repository at this point in the history
- Add .testing.MARK for reusable marks.
  • Loading branch information
khaeru committed Oct 29, 2024
1 parent 18d3ec2 commit c6403ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions genno/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
from contextlib import nullcontext
from functools import partial
from importlib.metadata import version
from itertools import chain, islice
from typing import TYPE_CHECKING, ContextManager, Dict

Expand Down Expand Up @@ -33,6 +34,14 @@

log = logging.getLogger(__name__)

# Common marks used in multiple places. Do not reuse keys.
MARK = {
"issue/145": pytest.mark.xfail(
condition="2024.10.0" == version("xarray"),
reason="with SparseDataArray only (https://github.com/pydata/xarray/issues/9694)",
),
}

# Pytest hooks


Expand Down
2 changes: 2 additions & 0 deletions genno/tests/core/test_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from genno.core.quantity import assert_quantity, get_class, set_class
from genno.core.sparsedataarray import SparseDataArray
from genno.testing import (
MARK,
add_large_data,
assert_qty_allclose,
assert_qty_equal,
Expand Down Expand Up @@ -481,6 +482,7 @@ def test_sel(self, tri, args, dropped) -> None:

assert ({"y"} if dropped else {"x", "y"}) == set(result.dims)

@MARK["issue/145"]
def test_sel_xarray(self, tri) -> None:
"""xarray-style indexing works."""
# Create indexers
Expand Down
2 changes: 2 additions & 0 deletions genno/tests/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from genno import Computer, operator
from genno.core.sparsedataarray import SparseDataArray
from genno.testing import (
MARK,
add_large_data,
add_test_data,
assert_logs,
Expand Down Expand Up @@ -844,6 +845,7 @@ def test_select0(data, indexers, kwargs, exp_dims, exp_shape) -> None:
assert exp_shape == result.size


@MARK["issue/145"]
def test_select1(data) -> None:
# Unpack
*_, t_foo, t_bar, x = data
Expand Down

0 comments on commit c6403ed

Please sign in to comment.