def mock_remove(path, ignore_errors=False, onerror=None):
     if path == test_filename and not mock_called:
         mock_called.append(True)
         raise Exception('Error')
     return real_rmtree(path, ignore_errors, onerror)
 def mock_remove(path, ignore_errors=False, onerror=None):
     if path == test_filename and not mock_called:
         mock_called.append(True)
         raise Exception('Error')
     return real_rmtree(path, ignore_errors, onerror)