From 5b227d9660ddab6a86f89d805ce75d8af9f55dda Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 23 Aug 2024 14:42:35 +0200 Subject: [PATCH 1/2] correct the name of the variable reduction test to something more accurate --- xarray_array_testing/reduction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray_array_testing/reduction.py b/xarray_array_testing/reduction.py index 54af662..e43ec18 100644 --- a/xarray_array_testing/reduction.py +++ b/xarray_array_testing/reduction.py @@ -15,7 +15,7 @@ def expected_errors(op, **parameters): @pytest.mark.parametrize("op", ["mean", "sum", "prod", "std", "var"]) @given(st.data()) - def test_variable_mean(self, op, data): + def test_variable(self, op, data): variable = data.draw(xrst.variables(array_strategy_fn=self.array_strategy_fn)) with self.expected_errors(op, variable=variable): From 5ae1bb1beeffb6c032d03495379d38fc1c15a663 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Fri, 23 Aug 2024 15:43:51 +0200 Subject: [PATCH 2/2] call the test function `numerical_reduce` this means we don't have to rename again when we add boolean reduce (`all`, `any`), cumulative reduce (`cumsum`, `cumprod`), ordering (`min`, `max`, `median`), and indexing ordering (`argmin`, `argmax`) tests. --- xarray_array_testing/reduction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray_array_testing/reduction.py b/xarray_array_testing/reduction.py index e43ec18..fb4b158 100644 --- a/xarray_array_testing/reduction.py +++ b/xarray_array_testing/reduction.py @@ -15,7 +15,7 @@ def expected_errors(op, **parameters): @pytest.mark.parametrize("op", ["mean", "sum", "prod", "std", "var"]) @given(st.data()) - def test_variable(self, op, data): + def test_variable_numerical_reduce(self, op, data): variable = data.draw(xrst.variables(array_strategy_fn=self.array_strategy_fn)) with self.expected_errors(op, variable=variable):