Archive

Posts Tagged ‘validate_cert’

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

May 27, 2016 Leave a comment

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: ,