def test_argsort_k_smallest_zero(x): assert len(argsort_k_smallest(x, 0)) == 0
def test_argsort_k_smallest_None(x): assert len(argsort_k_smallest(x, None)) == len(x)
def test_argsort_k_smallest(x, k): assume(len(x) >= k) assume(len(set(x)) == len(x)) assume(not np.isnan(x).any()) assert (np.argsort(x)[:k] == argsort_k_smallest(x, k)).all()