#NEWLINE# def test_selection_function_2( self ) : #NEWLINE# #INDENT# ' Test tournament selection with tournament size 0' #NEWLINE# self . ga . current_generation = self . population #NEWLINE# self . ga . calculate_population_fitness ( ) #NEWLINE# self . ga . tournament_size = 0 #NEWLINE# self . ga . selection_function = self . ga . tournament_selection #NEWLINE# individual = self . ga . selection_function ( self . ga . current_generation ) #NEWLINE# assert ( len ( individual . genes ) == 5 ) #NEWLINE# assert ( individual in self . population )