Skip to content

Commit e582545

Browse files
committed
Skip redundant special cases
1 parent 86a9756 commit e582545

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

array_api_tests/test_special_cases.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def diff_sign(i1: float, i2: float) -> bool:
174174

175175
repr_to_value = {
176176
"NaN": float("nan"),
177-
"infinity": float("infinity"),
177+
"infinity": float("inf"),
178178
"0": 0.0,
179179
"1": 1.0,
180180
}
@@ -581,6 +581,9 @@ def __call__(self, groups: Tuple[str, ...]) -> BinaryCase:
581581
}
582582

583583

584+
r_redundant_case = re.compile("result.+determined by the rule already stated above")
585+
586+
584587
def parse_binary_docstring(docstring: str) -> List[BinaryCase]:
585588
match = r_special_cases.search(docstring)
586589
if match is None:
@@ -593,6 +596,8 @@ def parse_binary_docstring(docstring: str) -> List[BinaryCase]:
593596
else:
594597
warn(f"line not machine-readable: '{line}'")
595598
continue
599+
if r_redundant_case.search(case):
600+
continue
596601
for pattern, make_case in binary_pattern_to_case_factory.items():
597602
if m := pattern.search(case):
598603
try:

0 commit comments

Comments
 (0)