#NEWLINE# @ contextmanager #NEWLINE# def setup_terminate( self ) : #NEWLINE# #INDENT# with mock . patch . object ( ProcessManager , '_kill' , ** PATCH_OPTS ) as mock_kill , mock . patch . object ( ProcessManager , 'is_alive' , ** PATCH_OPTS ) as mock_alive , mock . patch . object ( ProcessManager , 'purge_metadata' , ** PATCH_OPTS ) as mock_purge : #NEWLINE# #INDENT# ( yield ( mock_kill , mock_alive , mock_purge ) ) #NEWLINE# self . assertGreater ( mock_alive . call_count , 0 )