def METHOD_NAME(self, get_connection):
    error_message = array_settings.DUMMY_ERROR_MESSAGE
    get_connection.side_effect = [Exception(error_message)]
    with self.assertRaises(Exception) as ex:
        with self.array_connection:
            pass
    self.assertTrue(error_message in str(ex.exception))
    self.assertEqual(1, get_connection.call_count)