MCPcopy Create free account
hub / github.com/apache/impala / kudu_client

Function kudu_client

tests/conftest.py:431–449  ·  view source on GitHub ↗

Provides a new Kudu client as a pytest fixture. The client only exists for the duration of the method it is used in.

(request)

Source from the content-addressed store, hash-verified

429
430@pytest.fixture
431def kudu_client(request):
432 """Provides a new Kudu client as a pytest fixture. The client only exists for the
433 duration of the method it is used in.
434 """
435 kudu_master = request.config.option.kudu_master_hosts
436
437 if "," in kudu_master:
438 raise Exception("Multi-master not supported yet")
439 if ":" in kudu_master:
440 host, port = kudu_master.split(":")
441 else:
442 host, port = kudu_master, DEFAULT_KUDU_MASTER_PORT
443 kudu_client = kudu_connect(host, port)
444 yield kudu_client
445
446 try:
447 kudu_client.close()
448 except Exception as e:
449 LOG.warn("Error closing Kudu client: %s", e)
450
451
452@pytest.fixture(scope="class")

Callers

nothing calls this directly

Calls 2

warnMethod · 0.80
closeMethod · 0.65

Tested by

no test coverage detected