Skip to content

Commit

Permalink
Update test_core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Jul 7, 2023
1 parent 37d289f commit 22421f6
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def dask_array_ones(*args):
)

if TYPE_CHECKING:
from flox.core import T_Engine, T_ExpectedGroupsOpt, T_Func2
from flox.core import T_Engine, T_ExpectedGroupsOpt, T_Agg, T_Method


def _get_array_func(func: str) -> Callable:
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_alignment_error():
)
def test_groupby_reduce(
engine: T_Engine,
func: T_Func2,
func: T_Agg,
array: np.ndarray,
by: np.ndarray,
expected: list[float],
Expand Down Expand Up @@ -1356,36 +1356,22 @@ def test_validate_reindex_map_reduce(


def test_validate_reindex() -> None:
method: T_Method
for method in ["map-reduce", "cohorts"]:
with pytest.raises(NotImplementedError):
_validate_reindex(
True,
"argmax",
method, # type: ignore [arg-type] # Error testing.
expected_groups=None,
any_by_dask=False,
is_dask_array=True,
True, "argmax", method, expected_groups=None, any_by_dask=False, is_dask_array=True
)

for method in ["blockwise", "cohorts"]:
with pytest.raises(ValueError):
_validate_reindex(
True,
"sum",
method, # type: ignore [arg-type] # Error testing.
expected_groups=None,
any_by_dask=False,
is_dask_array=True,
True, "sum", method, expected_groups=None, any_by_dask=False, is_dask_array=True
)

for func in ["sum", "argmax"]:
actual = _validate_reindex(
None,
func,
method, # type: ignore [arg-type] # Lazy
expected_groups=None,
any_by_dask=False,
is_dask_array=True,
None, func, method, expected_groups=None, any_by_dask=False, is_dask_array=True
)
assert actual is False

Expand Down

0 comments on commit 22421f6

Please sign in to comment.