def test_contains_inf():
 arr = np.random.random(100)
 assert (not contains_inf(arr))
 arr[0] = np.nan
 assert (not contains_inf(arr))
 arr[1] = np.inf
 assert contains_inf(arr)
 arr[1] = (- np.inf)
 assert contains_inf(arr)

def test_contains_inf ( ) : arr = np . random . random ( 100 ) assert ( not contains_inf ( arr ) ) arr [ 0 ] = np . nan assert ( not contains_inf ( arr ) ) arr [ 1 ] = np . inf assert contains_inf ( arr ) arr [ 1 ] = ( - np . inf ) assert contains_inf ( arr )
tests that pylearn2 .