2
2
3
3
import hypothesis .strategies as st
4
4
import xarray .testing .strategies as xrst
5
- from hypothesis import given
5
+ from hypothesis import given , settings , HealthCheck , note
6
6
7
7
from xarray_array_testing .base import DuckArrayTestMixin
8
8
@@ -12,16 +12,22 @@ class ReductionTests(DuckArrayTestMixin):
12
12
def expected_errors (op , ** parameters ):
13
13
return nullcontext ()
14
14
15
+ # TODO understand the differing executors health check error
16
+ @settings (suppress_health_check = [HealthCheck .differing_executors ])
15
17
@given (st .data ())
16
18
def test_variable_mean (self , data ):
17
19
variable = data .draw (xrst .variables (array_strategy_fn = self .array_strategy_fn ))
18
20
21
+ note (f"note: { variable } " )
22
+
19
23
with self .expected_errors ("mean" , variable = variable ):
20
24
actual = variable .mean ().data
21
25
expected = self .xp .mean (variable .data )
22
26
23
- self .assert_equal (actual , expected )
27
+ assert isinstance (actual , self .array_type ), type (actual )
28
+ self .assert_equal (actual , expected )
24
29
30
+ @settings (suppress_health_check = [HealthCheck .differing_executors ])
25
31
@given (st .data ())
26
32
def test_variable_prod (self , data ):
27
33
variable = data .draw (xrst .variables (array_strategy_fn = self .array_strategy_fn ))
@@ -30,4 +36,5 @@ def test_variable_prod(self, data):
30
36
actual = variable .prod ().data
31
37
expected = self .xp .prod (variable .data )
32
38
33
- self .assert_equal (actual , expected )
39
+ assert isinstance (actual , self .array_type ), type (actual )
40
+ self .assert_equal (actual , expected )
0 commit comments