def __init__(self, host=None, port=None, auth_mech=None):
        if host is not None:
            self.host = host
        elif 'IMPYLA_TEST_HOST' in os.environ:
            self.host = os.environ['IMPYLA_TEST_HOST']
        else:
            sys.stderr.write("IMPYLA_TEST_HOST not set; using 'localhost'")
            self.host = 'localhost'

        if port is not None:
            self.port = port
        elif 'IMPYLA_TEST_PORT' in os.environ:
            self.port = int(os.environ['IMPYLA_TEST_PORT'])
        else:
            sys.stderr.write("IMPYLA_TEST_PORT not set; using 21050")
            self.port = 21050

        if auth_mech is not None:
            self.auth_mech = auth_mech
        elif 'IMPYLA_TEST_AUTH_MECH' in os.environ:
            self.auth_mech = os.environ['IMPYLA_TEST_AUTH_MECH']
        else:
            sys.stderr.write("IMPYLA_TEST_AUTH_MECH not set; using 'NOSASL'")
            self.auth_mech = 'NOSASL'
dataset/ETHPy150Open cloudera/impyla/impala/tests/util.py/ImpylaTestEnv.__init__/original