def METHOD_NAME(self):
    fp = tempfile.NamedTemporaryFile()
    ssh_args = self.docker_ssh_default_kwargs.get('ssh_args', [])
    try:
        e = self.assertRaises(mitogen.ssh.HostKeyError,
            lambda: self.docker_ssh(
                username='mitogen__has_sudo_pubkey',
                password='has_sudo_password',
                ssh_args=ssh_args + ['-o', 'UserKnownHostsFile %s' % fp.name],
                check_host_keys='enforce',
            )
        )
        self.assertEqual(e.args[0], mitogen.ssh.hostkey_failed_msg)
    finally:
        fp.close()