#NEWLINE# def test_rvs( self ) : #NEWLINE# #INDENT# vals = stats . hypergeom . rvs ( 20 , 10 , 3 , size = ( 2 , 50 ) ) #NEWLINE# assert_ ( ( numpy . all ( ( vals >= 0 ) ) & numpy . all ( ( vals <= 3 ) ) ) ) #NEWLINE# assert_ ( ( numpy . shape ( vals ) == ( 2 , 50 ) ) ) #NEWLINE# assert_ ( ( vals . dtype . char in typecodes [ 'AllInteger' ] ) ) #NEWLINE# val = stats . hypergeom . rvs ( 20 , 3 , 10 ) #NEWLINE# assert_ ( isinstance ( val , int ) ) #NEWLINE# val = stats . hypergeom ( 20 , 3 , 10 ) . rvs ( 3 ) #NEWLINE# assert_ ( isinstance ( vals , numpy . ndarray ) ) #NEWLINE# assert_ ( ( val . dtype . char in typecodes [ 'AllInteger' ] ) )