def test_check_X_not_min_samples(): try: check_X(np.ones((5)), min_samples=6, verbose=False) assert False except ValueError: check_X(np.ones((5)), min_samples=5, verbose=False) assert True
def test_check_X_too_many_dims(): """check_X accepts at most 2D inputs""" try: check_X(np.ones((5, 4, 3))) assert False except ValueError: check_X(np.ones((5, 4))) assert True
def test_check_X_not_int_not_float(): """X must be an in or a float""" try: check_X(['hi'], verbose=False) assert False except ValueError: check_X([4], verbose=False) assert True
def test_check_X_not_int_not_float(): """X must be an in or a float""" with pytest.raises(ValueError): check_X(['hi'], verbose=False)
def test_check_X_not_min_samples(): with pytest.raises(ValueError): check_X(np.ones((5)), min_samples=6, verbose=False)
def test_check_X_too_many_dims(): """check_X accepts at most 2D inputs""" with pytest.raises(ValueError): check_X(np.ones((5, 4, 3)))