|
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,
|
@@ -362,9 +362,17 @@ def test_divide(args):
|
362 | 362 | # could test that this does implement IEEE 754 division, but we don't yet
|
363 | 363 | # have those sorts in general for this module.
|
364 | 364 |
|
365 |
| -@given(two_any_dtypes.flatmap(lambda i: two_array_scalars(*i))) |
366 |
| -def test_equal(args): |
367 |
| - x1, x2 = args |
| 365 | + |
| 366 | + |
| 367 | +@given( |
| 368 | + x1=shared( |
| 369 | + xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes()), key='arrays' |
| 370 | + ), |
| 371 | + x2=shared( |
| 372 | + xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes()), key='arrays' |
| 373 | + ), |
| 374 | +) |
| 375 | +def test_equal(x1, x2): |
368 | 376 | sanity_check(x1, x2)
|
369 | 377 | a = _array_module.equal(x1, x2)
|
370 | 378 | # NOTE: assert_exactly_equal() itself uses equal(), so we must be careful
|
|
0 commit comments