def test_use_privatekey(self):
    '\n        `Context.use_privatekey` takes an `OpenSSL.crypto.PKey` instance.\n        '
    key = PKey()
    key.generate_key(TYPE_RSA, 512)
    ctx = Context(TLSv1_METHOD)
    ctx.use_privatekey(key)
    with pytest.raises(TypeError):
        ctx.use_privatekey('')
`Context.use_privatekey` takes an `OpenSSL.crypto.PKey` instance.
def test_use_privatekey(self):
    '\n        \n        '
    key = PKey()
    key.generate_key(TYPE_RSA, 512)
    ctx = Context(TLSv1_METHOD)
    ctx.use_privatekey(key)
    with pytest.raises(TypeError):
        ctx.use_privatekey()