def test_passwd_callback_exception(self, tmpfile):
    '\n        `Context.use_privatekey_file` propagates any exception raised\n        by the passphrase callback.\n        '
    pemFile = self._write_encrypted_pem(b'monkeys are nice', tmpfile)

    def passphraseCallback(maxlen, verify, extra):
        raise RuntimeError('Sorry, I am a fail.')
    context = Context(TLSv1_METHOD)
    context.set_passwd_cb(passphraseCallback)
    with pytest.raises(RuntimeError):
        context.use_privatekey_file(pemFile)
`Context.use_privatekey_file` propagates any exception raised
by the passphrase callback.
def test_passwd_callback_exception(self, tmpfile):
    '\n        `Context.use_privatekey_file` propagates any exception raised\n        by the passphrase callback.\n        '
    pemFile = self._write_encrypted_pem(b'monkeys are nice', tmpfile)

    def passphraseCallback(maxlen, verify, extra):
        raise RuntimeError('Sorry, I am a fail.')
    context = Context(TLSv1_METHOD)
    context.set_passwd_cb(passphraseCallback)
    with pytest.raises(RuntimeError):
        context.use_privatekey_file(pemFile)