Home > python > TypeError: initialize() got an unexpected keyword argument ‘validate_cert’

TypeError: initialize() got an unexpected keyword argument ‘validate_cert’

Problem:
I was getting the following error, when running an applications’ tests. The application itself was running without an issue, it uses tornado. The tests on the other hand were failing with the following error.

TypeError: initialize() got an unexpected keyword argument 'validate_cert'

Solution:
I have no idea as to why but changing the code to use defaults=dict(… worked.

class AsyncHTTPSTestCase(AsyncHTTPTestCase):
    """A test case that starts an HTTPS server.

    Interface is generally the same as `AsyncHTTPTestCase`.
    """
    def get_http_client(self):
        return AsyncHTTPClient(io_loop=self.io_loop, force_instance=True,
                               defaults=dict(validate_cert=False))

Source:
http://www.tornadoweb.org/en/stable/_modules/tornado/testing.html

Advertisements
Categories: python Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: