def test_raises_value_error_non_sum_one():
 P = np.array([[0.4, 0.6], [0.2, 0.9]])
 assert_raises(ValueError, MarkovChain, P)
 assert_raises(ValueError, MarkovChain, sparse.csr_matrix(P))

def test_raises_value_error_non_sum_one ( ) : P = np . array ( [ [ 0.4 , 0.6 ] , [ 0.2 , 0.9 ] ] ) assert_raises ( ValueError , MarkovChain , P ) assert_raises ( ValueError , MarkovChain , sparse . csr_matrix ( P ) )
test with input such that some of the rows does not sum to one .