Skip to content

Commit c21d169

Browse files
committed
Reformatted files using black and isort
1 parent 88ad0bc commit c21d169

24 files changed

+657
-693
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import re
1717
import textwrap
1818

19-
from setuptools import setup, find_packages
19+
from setuptools import find_packages, setup
2020

2121
_version_re = re.compile(r"__version__\s+=\s+(.*)")
2222

@@ -75,7 +75,7 @@
7575
"Programming Language :: Python :: Implementation :: PyPy",
7676
"Topic :: Database :: Front-Ends",
7777
],
78-
python_requires='>=3.7',
78+
python_requires=">=3.7",
7979
install_requires=["pytz", "requests"],
8080
extras_require={
8181
"all": all_require,

tests/integration/conftest.py

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
from uuid import uuid4
1919

2020
import click
21-
import trino.logging
2221
import 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

2727
logger = trino.logging.get_logger(__name__)
2828

@@ -64,13 +64,7 @@ def start_trino(image_tag=None):
6464

6565

6666
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"))
7468
sql = "SELECT state FROM system.runtime.nodes"
7569
t0 = time.time()
7670
while True:
@@ -116,9 +110,7 @@ def start_trino_and_wait(image_tag=None):
116110
if host:
117111
port = os.environ.get("TRINO_RUNNING_PORT", DEFAULT_PORT)
118112
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)
122114

123115
print("trino.server.hostname {}".format(host))
124116
print("trino.server.port {}".format(port))
@@ -135,9 +127,7 @@ def stop_trino(container_id, proc):
135127

136128
def find_images(name):
137129
assert name
138-
output = subprocess.check_output(
139-
["docker", "images", "--format", "{{.Repository}}:{{.Tag}}", name]
140-
)
130+
output = subprocess.check_output(["docker", "images", "--format", "{{.Repository}}:{{.Tag}}", name])
141131
return [line.decode() for line in output.splitlines()]
142132

143133

@@ -167,9 +157,7 @@ def cli():
167157
pass
168158

169159

170-
@click.option(
171-
"--cache/--no-cache", default=True, help="enable/disable Docker build cache"
172-
)
160+
@click.option("--cache/--no-cache", default=True, help="enable/disable Docker build cache")
173161
@click.command()
174162
def trino_server():
175163
container_id, _, _, _ = start_trino_and_wait()
@@ -198,19 +186,14 @@ def trino_cli(container_id=None):
198186

199187
@cli.command("list")
200188
def list_():
201-
subprocess.check_call(
202-
["docker", "ps", "--filter", "name=trino-python-client-tests-"]
203-
)
189+
subprocess.check_call(["docker", "ps", "--filter", "name=trino-python-client-tests-"])
204190

205191

206192
@cli.command()
207193
def clean():
208194
cmd = (
209-
"docker ps "
210-
"--filter name=trino-python-client-tests- "
211-
"--format={{.Names}} | "
212-
"xargs -n 1 docker kill" # NOQA deliberate additional indent
213-
)
195+
"docker ps " "--filter name=trino-python-client-tests- " "--format={{.Names}} | " "xargs -n 1 docker kill"
196+
) # NOQA deliberate additional indent
214197
subprocess.check_output(cmd, shell=True)
215198

216199

0 commit comments

Comments
 (0)