def METHOD_NAME(
    caplog,
    _instance,
):
    _instance._config.command_args = {"host": "inst"}
    hosts = ["instance-1", "instance-2"]
    with pytest.raises(SystemExit) as e:
        _instance._get_hostname(hosts)
    assert e.value.code == 1
    msg = (
        "There are 2 hosts that match 'inst'. "
        "You can only login to one at a time.\n\n"
        "Available hosts:\n"
        "instance-1\n"
        "instance-2"
    )
    assert msg in caplog.text