Skip to content

Commit db2b793

Browse files
committed
Improve: List skipped entries in PyTest
1 parent 7e3f329 commit db2b793

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/test.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,15 +479,16 @@ def test_dot_complex_explicit(ndim):
479479

480480

481481
@pytest.mark.skipif(not numpy_available, reason="NumPy is not installed")
482-
@pytest.mark.repeat(200)
482+
@pytest.mark.repeat(300)
483483
@pytest.mark.parametrize("dtype", ["uint16", "uint32"])
484-
def test_intersect(dtype):
484+
@pytest.mark.parametrize("length_bound", [10, 25, 1000])
485+
def test_intersect(dtype, length_bound):
485486
"""Compares the simd.intersect() function with numpy.intersect1d."""
486487
np.random.seed()
487-
a_length = np.random.randint(1, 1024)
488-
b_length = np.random.randint(1, 1024)
489-
a = np.random.randint(2048, size=a_length, dtype=dtype)
490-
b = np.random.randint(2048, size=b_length, dtype=dtype)
488+
a_length = np.random.randint(1, length_bound)
489+
b_length = np.random.randint(1, length_bound)
490+
a = np.random.randint(length_bound * 2, size=a_length, dtype=dtype)
491+
b = np.random.randint(length_bound * 2, size=b_length, dtype=dtype)
491492

492493
# Remove duplicates, converting into sorted arrays
493494
a = np.unique(a)
@@ -496,7 +497,7 @@ def test_intersect(dtype):
496497
expected = baseline_intersect(a, b)
497498
result = simd.intersect(a, b)
498499

499-
assert int(expected) == int(result)
500+
assert int(expected) == int(result), f"Missing {np.intersect1d(a, b)} from {a} and {b}"
500501

501502

502503
@pytest.mark.skipif(not numpy_available, reason="NumPy is not installed")

0 commit comments

Comments
 (0)