Skip to content

Commit 0fb669e

Browse files
fix: use ConstantFlightServerDelayed in timeout tests and clean up formatting
1 parent 2e59253 commit 0fb669e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_query.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_query_proxy_base_client(self):
138138
)
139139

140140
assert client._query_api._proxy == test_proxy
141-
assert ('grpc.http_proxy', test_proxy) in\
141+
assert ('grpc.http_proxy', test_proxy) in \
142142
client._query_api._flight_client_options.get('generic_options')
143143

144144
def create_cert_file(self, file_name):
@@ -154,9 +154,9 @@ def test_query_api_options_builder(self):
154154
cert_file = "cert_test.pem"
155155
self.create_cert_file(cert_file)
156156
builder = QueryApiOptionsBuilder()
157-
options = builder.proxy(proxy_name)\
158-
.root_certs(cert_file)\
159-
.tls_verify(False)\
157+
options = builder.proxy(proxy_name) \
158+
.root_certs(cert_file) \
159+
.tls_verify(False) \
160160
.build()
161161

162162
try:
@@ -175,7 +175,7 @@ def test_query_client_with_options(self):
175175
cert_chain = 'mTLS_explicit_chain'
176176
self.create_cert_file(cert_file)
177177
test_flight_client_options = {'private_key': private_key, 'cert_chain': cert_chain}
178-
options = QueryApiOptionsBuilder()\
178+
options = QueryApiOptionsBuilder() \
179179
.proxy(proxy_name) \
180180
.root_certs(cert_file) \
181181
.tls_verify(False) \
@@ -436,7 +436,7 @@ async def fibo(iters):
436436
@asyncio_run
437437
async def test_query_async_timeout(self):
438438
with pytest.raises(FlightTimedOutError):
439-
with ConstantFlightServer() as server:
439+
with ConstantFlightServerDelayed(delay=1) as server:
440440
connection_string = f"grpc://localhost:{server.port}"
441441
token = "my_token"
442442
database = "my_database"
@@ -452,7 +452,7 @@ async def test_query_async_timeout(self):
452452

453453
def test_query_timeout_per_call_override(self):
454454
with pytest.raises(FlightTimedOutError):
455-
with ConstantFlightServer() as server:
455+
with ConstantFlightServerDelayed(delay=1) as server:
456456
connection_string = f"grpc://localhost:{server.port}"
457457
token = "my_token"
458458
database = "my_database"

0 commit comments

Comments
 (0)