def METHOD_NAME(opts_userpass):
    opts = opts_userpass.copy()
    del opts["proxy"]["passwords"]
    with patch("salt.proxy.esxcluster.merge", MagicMock(return_value=opts["proxy"])):
        with pytest.raises(salt.exceptions.InvalidConfigError) as excinfo:
            esxcluster.init(opts)
    assert (
        excinfo.value.message == "Mechanism is set to 'userpass', but no "
        "'passwords' key found in proxy config."
    )