Skip to content

Commit c7956f9

Browse files
committed
Sanity check special case params and stubs
1 parent ddcbce0 commit c7956f9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

array_api_tests/stubs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@
7272
for func in funcs:
7373
if func.__name__ not in name_to_func.keys():
7474
name_to_func[func.__name__] = func
75+
76+
# sanity check public attributes are not empty
77+
for attr in __all__:
78+
assert len(locals()[attr]) != 0, f"{attr} is empty"

array_api_tests/test_special_cases.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,11 @@ def parse_binary_case_block(case_block: str) -> List[BinaryCase]:
11971197
# its False - Hypothesis will complain if we reject too many examples, thus
11981198
# indicating we've done something wrong.
11991199

1200+
# sanity checks
1201+
assert len(unary_params) != 0
1202+
assert len(binary_params) != 0
1203+
assert len(iop_params) != 0
1204+
12001205

12011206
@pytest.mark.parametrize("func_name, func, case", unary_params)
12021207
@given(

0 commit comments

Comments
 (0)