#NEWLINE# @ ignore_warnings #NEWLINE# def test_non_negative_factorization_checking( ) : #NEWLINE# #INDENT# A = np . ones ( ( 2 , 2 ) ) #NEWLINE# nnmf = non_negative_factorization #NEWLINE# msg = "Number of components must be positive; got (n_components='2')" #NEWLINE# assert_raise_message ( ValueError , msg , nnmf , A , A , A , '2' ) #NEWLINE# msg = 'Negative values in data passed to NMF (input H)' #NEWLINE# assert_raise_message ( ValueError , msg , nnmf , A , A , ( - A ) , 2 , 'custom' ) #NEWLINE# msg = 'Negative values in data passed to NMF (input W)' #NEWLINE# assert_raise_message ( ValueError , msg , nnmf , A , ( - A ) , A , 2 , 'custom' ) #NEWLINE# msg = 'Array passed to NMF (input H) is full of zeros' #NEWLINE# assert_raise_message ( ValueError , msg , nnmf , A , A , ( 0 * A ) , 2 , 'custom' )