|
15 | 15 | """
|
16 | 16 |
|
17 | 17 | from hypothesis import given, assume
|
18 |
| -from hypothesis.strategies import composite, just |
| 18 | +from hypothesis.strategies import composite, just, shared |
19 | 19 |
|
20 | 20 | import math
|
21 | 21 |
|
|
26 | 26 | boolean_dtype_objects, floating_dtypes,
|
27 | 27 | numeric_dtypes, integer_or_boolean_dtypes,
|
28 | 28 | boolean_dtypes, mutually_promotable_dtypes,
|
29 |
| - array_scalars) |
| 29 | + array_scalars, xps) |
30 | 30 | from .array_helpers import (assert_exactly_equal, negative,
|
31 | 31 | positive_mathematical_sign,
|
32 | 32 | negative_mathematical_sign, logical_not,
|
@@ -374,9 +374,17 @@ def test_divide(args):
|
374 | 374 | # could test that this does implement IEEE 754 division, but we don't yet
|
375 | 375 | # have those sorts in general for this module.
|
376 | 376 |
|
377 |
| -@given(two_any_dtypes.flatmap(lambda i: two_array_scalars(*i))) |
378 |
| -def test_equal(args): |
379 |
| - x1, x2 = args |
| 377 | + |
| 378 | + |
| 379 | +@given( |
| 380 | + x1=shared( |
| 381 | + xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes()), key='arrays' |
| 382 | + ), |
| 383 | + x2=shared( |
| 384 | + xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes()), key='arrays' |
| 385 | + ), |
| 386 | +) |
| 387 | +def test_equal(x1, x2): |
380 | 388 | sanity_check(x1, x2)
|
381 | 389 | a = _array_module.equal(x1, x2)
|
382 | 390 | # NOTE: assert_exactly_equal() itself uses equal(), so we must be careful
|
|
0 commit comments