|
18 | 18 | from uuid import uuid4
|
19 | 19 |
|
20 | 20 | import click
|
21 |
| -import trino.logging |
22 | 21 | import pytest
|
23 |
| -from trino.client import TrinoQuery, TrinoRequest, ClientSession |
24 |
| -from trino.constants import DEFAULT_PORT |
25 | 22 |
|
| 23 | +import trino.logging |
| 24 | +from trino.client import ClientSession, TrinoQuery, TrinoRequest |
| 25 | +from trino.constants import DEFAULT_PORT |
26 | 26 |
|
27 | 27 | logger = trino.logging.get_logger(__name__)
|
28 | 28 |
|
@@ -64,13 +64,7 @@ def start_trino(image_tag=None):
|
64 | 64 |
|
65 | 65 |
|
66 | 66 | def wait_for_trino_workers(host, port, timeout=180):
|
67 |
| - request = TrinoRequest( |
68 |
| - host=host, |
69 |
| - port=port, |
70 |
| - client_session=ClientSession( |
71 |
| - user="test_fixture" |
72 |
| - ) |
73 |
| - ) |
| 67 | + request = TrinoRequest(host=host, port=port, client_session=ClientSession(user="test_fixture")) |
74 | 68 | sql = "SELECT state FROM system.runtime.nodes"
|
75 | 69 | t0 = time.time()
|
76 | 70 | while True:
|
@@ -116,9 +110,7 @@ def start_trino_and_wait(image_tag=None):
|
116 | 110 | if host:
|
117 | 111 | port = os.environ.get("TRINO_RUNNING_PORT", DEFAULT_PORT)
|
118 | 112 | else:
|
119 |
| - container_id, proc, host, port = start_local_trino_server( |
120 |
| - image_tag |
121 |
| - ) |
| 113 | + container_id, proc, host, port = start_local_trino_server(image_tag) |
122 | 114 |
|
123 | 115 | print("trino.server.hostname {}".format(host))
|
124 | 116 | print("trino.server.port {}".format(port))
|
@@ -167,9 +159,7 @@ def cli():
|
167 | 159 | pass
|
168 | 160 |
|
169 | 161 |
|
170 |
| -@click.option( |
171 |
| - "--cache/--no-cache", default=True, help="enable/disable Docker build cache" |
172 |
| -) |
| 162 | +@click.option("--cache/--no-cache", default=True, help="enable/disable Docker build cache") |
173 | 163 | @click.command()
|
174 | 164 | def trino_server():
|
175 | 165 | container_id, _, _, _ = start_trino_and_wait()
|
@@ -198,9 +188,7 @@ def trino_cli(container_id=None):
|
198 | 188 |
|
199 | 189 | @cli.command("list")
|
200 | 190 | def list_():
|
201 |
| - subprocess.check_call( |
202 |
| - ["docker", "ps", "--filter", "name=trino-python-client-tests-"] |
203 |
| - ) |
| 191 | + subprocess.check_call(["docker", "ps", "--filter", "name=trino-python-client-tests-"]) |
204 | 192 |
|
205 | 193 |
|
206 | 194 | @cli.command()
|
|
0 commit comments