Skip to content

Commit 4807b86

Browse files
committed
Cleaned up hypothesis helper tests
1 parent 66c4121 commit 4807b86

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

array_api_tests/meta_tests/test_hypothesis_helpers.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,19 @@
1111
pytestmark = [pytest.mark.skipif(UNDEFINED_DTYPES, reason="undefined dtypes")]
1212

1313

14-
def test_promotable_dtypes():
15-
dtypes = set()
16-
@given(promotable_dtypes(xp.uint16))
17-
def run(dtype):
18-
dtypes.add(dtype)
19-
run()
20-
assert dtypes == {
14+
@given(promotable_dtypes(xp.uint16))
15+
def test_promotable_dtypes(dtype):
16+
assert dtype in (
2117
xp.uint8, xp.uint16, xp.uint32, xp.uint64, xp.int8, xp.int16, xp.int32, xp.int64
22-
}
18+
)
2319

2420

25-
def test_mutually_promotable_dtype_pairs():
26-
pairs = set()
27-
@given(mutually_promotable_dtype_pairs([xp.float32, xp.float64]))
28-
def run(pair):
29-
pairs.add(pair)
30-
run()
31-
assert pairs == {
21+
@given(mutually_promotable_dtype_pairs([xp.float32, xp.float64]))
22+
def test_mutually_promotable_dtype_pairs(pairs):
23+
assert pairs in (
3224
(xp.float32, xp.float32),
3325
(xp.float32, xp.float64),
3426
(xp.float64, xp.float32),
3527
(xp.float64, xp.float64),
36-
}
28+
)
3729

0 commit comments

Comments
 (0)