#NEWLINE# @ patch ( 'cabu.drivers.load_phantomjs' , return_value = MagicMock ( ) ) #NEWLINE# def test_unload_driver_fail( self , mock_driver ) : #NEWLINE# #INDENT# driver = load_driver ( self . config ) #NEWLINE# mock_driver . assert_called_once_with ( self . config ) #NEWLINE# driver . close = Mock ( ) #NEWLINE# driver . close . side_effect = Exception ( 'Boom !' ) #NEWLINE# unload_driver ( driver )