#NEWLINE# def test_create_numpy_array_from_generator_returns_expected_array( ) : #NEWLINE# #INDENT# expected_array = np . random . randint ( 0 , 999 , ( 5 , 4 ) ) . astype ( np . int32 ) #NEWLINE# overestimated_shape = ( 10 , 4 ) #NEWLINE# def input_generator( ) : #NEWLINE# #INDENT# for thing in expected_array : #NEWLINE# #INDENT# ( yield thing ) #NEWLINE# #UNINDENT# #UNINDENT# actual_array = data_splitting . create_numpy_array_from_generator ( generator = input_generator , overestimated_shape = overestimated_shape ) #NEWLINE# np . testing . assert_array_equal ( overestimated_shape , expected_array )