1818from uuid import uuid4
1919
2020import click
21- import trino .logging
2221import pytest
23- from trino .client import TrinoQuery , TrinoRequest , ClientSession
24- from trino .constants import DEFAULT_PORT
2522
23+ import trino .logging
24+ from trino .client import ClientSession , TrinoQuery , TrinoRequest
25+ from trino .constants import DEFAULT_PORT
2626
2727logger = trino .logging .get_logger (__name__ )
2828
@@ -68,8 +68,8 @@ def wait_for_trino_workers(host, port, timeout=180):
6868 host = host ,
6969 port = port ,
7070 client_session = ClientSession (
71- user = "test_fixture"
72- )
71+ user = "test_fixture" ,
72+ ),
7373 )
7474 sql = "SELECT state FROM system.runtime.nodes"
7575 t0 = time .time ()
@@ -116,9 +116,7 @@ def start_trino_and_wait(image_tag=None):
116116 if host :
117117 port = os .environ .get ("TRINO_RUNNING_PORT" , DEFAULT_PORT )
118118 else :
119- container_id , proc , host , port = start_local_trino_server (
120- image_tag
121- )
119+ container_id , proc , host , port = start_local_trino_server (image_tag )
122120
123121 print ("trino.server.hostname {}" .format (host ))
124122 print ("trino.server.port {}" .format (port ))
@@ -135,9 +133,7 @@ def stop_trino(container_id, proc):
135133
136134def find_images (name ):
137135 assert name
138- output = subprocess .check_output (
139- ["docker" , "images" , "--format" , "{{.Repository}}:{{.Tag}}" , name ]
140- )
136+ output = subprocess .check_output (["docker" , "images" , "--format" , "{{.Repository}}:{{.Tag}}" , name ])
141137 return [line .decode () for line in output .splitlines ()]
142138
143139
@@ -167,9 +163,7 @@ def cli():
167163 pass
168164
169165
170- @click .option (
171- "--cache/--no-cache" , default = True , help = "enable/disable Docker build cache"
172- )
166+ @click .option ("--cache/--no-cache" , default = True , help = "enable/disable Docker build cache" )
173167@click .command ()
174168def trino_server ():
175169 container_id , _ , _ , _ = start_trino_and_wait ()
@@ -198,9 +192,7 @@ def trino_cli(container_id=None):
198192
199193@cli .command ("list" )
200194def list_ ():
201- subprocess .check_call (
202- ["docker" , "ps" , "--filter" , "name=trino-python-client-tests-" ]
203- )
195+ subprocess .check_call (["docker" , "ps" , "--filter" , "name=trino-python-client-tests-" ])
204196
205197
206198@cli .command ()
0 commit comments