16
16
from warnings import warn
17
17
18
18
import pytest
19
- from hypothesis import HealthCheck , assume , given , settings
19
+ from hypothesis import assume , given
20
20
21
21
from . import dtype_helpers as dh
22
22
from . import hypothesis_helpers as hh
@@ -580,7 +580,19 @@ def __call__(self, groups: Tuple[str, ...]) -> BinaryCase:
580
580
581
581
binary_pattern_to_case_factory : Dict [Pattern , BinaryCaseFactory ] = {
582
582
re .compile (
583
- "If ``x1_i`` is (.+), ``x1_i`` (.+), "
583
+ "If ``x1_i`` is (.+), ``x1_i`` is (.+), ``x2_i`` is (.+), "
584
+ "and ``x2_i`` is (.+), the result is (.+)"
585
+ ): BinaryCaseFactory (
586
+ AndCondFactory (
587
+ ValueCondFactory ("i1" , 0 ),
588
+ ValueCondFactory ("i1" , 1 ),
589
+ ValueCondFactory ("i2" , 2 ),
590
+ ValueCondFactory ("i2" , 3 ),
591
+ ),
592
+ ResultCheckFactory (4 ),
593
+ ),
594
+ re .compile (
595
+ "If ``x1_i`` is (.+), ``x1_i`` is (.+), "
584
596
"and ``x2_i`` is (.+), the result is (.+)"
585
597
): BinaryCaseFactory (
586
598
AndCondFactory (
@@ -591,7 +603,7 @@ def __call__(self, groups: Tuple[str, ...]) -> BinaryCase:
591
603
ResultCheckFactory (3 ),
592
604
),
593
605
re .compile (
594
- "If ``x1_i`` is (.+), ``x2_i`` (.+), "
606
+ "If ``x1_i`` is (.+), ``x2_i`` is (.+), "
595
607
"and ``x2_i`` is (.+), the result is (.+)"
596
608
): BinaryCaseFactory (
597
609
AndCondFactory (
@@ -601,7 +613,7 @@ def __call__(self, groups: Tuple[str, ...]) -> BinaryCase:
601
613
),
602
614
ResultCheckFactory (3 ),
603
615
),
604
- # This case must come after the above to avoid false matches
616
+ # This pattern must come after the above to avoid false matches
605
617
re .compile (
606
618
"If ``x1_i`` is (.+) and ``x2_i`` is (.+), the result is (.+)"
607
619
): BinaryCaseFactory (
@@ -760,7 +772,6 @@ def test_unary(func_name, func, cases, x):
760
772
two_shapes = hh .mutually_broadcastable_shapes (2 , min_side = 1 ),
761
773
)
762
774
)
763
- @settings (suppress_health_check = [HealthCheck .filter_too_much ]) # TODO: remove
764
775
def test_binary (func_name , func , cases , x1 , x2 ):
765
776
res = func (x1 , x2 )
766
777
good_example = False
0 commit comments