def pytest_configure(self, config):
        options = config.option
        url = options.server or 'localhost:%d' % options.port
        secure, host, port, path = remote_api.parse_url(url)
        if host == 'localhost':
            # We need to start up a clean new appserver for testing.
            self.threads.append(AppServerRunner(options.port, options.mailport))
        self.threads.append(MailThread(options.mailport))
        for thread in self.threads:
            thread.start()
        for thread in self.threads:
            thread.wait_until_ready()

        # Connect to the datastore.
        url, app_id = remote_api.connect(url)

        # Reset the datastore for the first test.
        reset_data()

        # Give the tests access to configuration information.
        config.hostport = '%s:%d' % (host, port)
        config.mail_server = MailThread
    def pytest_configure(self, config):
        options = config.option
        url = options.server or 'localhost:%d' % options.port
        secure, host, port, path = remote_api.parse_url(url)
        if host == 'localhost':
            # We need to start up a clean new appserver for testing.
            self.threads.append(AppServerRunner(options.port, options.mailport))
        self.threads.append(MailThread(options.mailport))
        for thread in self.threads:
            thread.start()
        for thread in self.threads:
            thread.wait_until_ready()

        # Connect to the datastore.
        remote_api.connect(url, server_type='local')

        # Reset the datastore for the first test.
        reset_data()

        # Give the tests access to configuration information.
        config.hostport = '%s:%d' % (host, port)
        config.mail_server = MailThread