#NEWLINE# def test_max_instances_reached( self , scheduler , job , jobstore , executor , caplog ) : #NEWLINE# #INDENT# 'Tests that a warning is logged when the maximum instances of a job is reached.' #NEWLINE# caplog . set_level ( logging . WARNING ) #NEWLINE# executor . submit_job = MagicMock ( side_effect = MaxInstancesReachedError ( job ) ) #NEWLINE# assert ( scheduler . _process_jobs ( ) is None ) #NEWLINE# assert ( len ( caplog . records ) == 1 ) #NEWLINE# assert ( caplog . records [ 0 ] . message == 'Execution of job "job 999" skipped: maximum number of running instances reached (1)' )