Skip to content

Commit b35f6f1

Browse files
committed
fixed lint
1 parent 32b4db0 commit b35f6f1

2 files changed

Lines changed: 33 additions & 12 deletions

File tree

packages/google-cloud-firestore/tests/system/test_system.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def cleanup():
8383
for operation in operations:
8484
operation()
8585

86+
8687
@pytest.fixture
8788
def verify_pipeline(subtests):
8889
"""
@@ -98,8 +99,8 @@ def verify_pipeline(subtests):
9899

99100
def _verifier(query):
100101
from google.cloud.firestore_v1.base_aggregation import BaseAggregationQuery
101-
with subtests.test(msg="verify_pipeline"):
102102

103+
with subtests.test(msg="verify_pipeline"):
103104
client = query._client
104105
if FIRESTORE_EMULATOR:
105106
pytest.skip("skip pipeline verification on emulator")
@@ -131,7 +132,9 @@ def _clean_results(results):
131132
)
132133
else:
133134
# other qureies return a simple list of results
134-
query_results = _clean_results([s.to_dict() for s in query.get()])
135+
query_results = _clean_results(
136+
[s.to_dict() for s in query.get()]
137+
)
135138
except Exception as e:
136139
# if we expect the query to fail, capture the exception
137140
query_exception = e
@@ -142,7 +145,9 @@ def _clean_results(results):
142145
pipeline.execute()
143146
else:
144147
# ensure results match query
145-
pipeline_results = _clean_results([s.data() for s in pipeline.execute()])
148+
pipeline_results = _clean_results(
149+
[s.data() for s in pipeline.execute()]
150+
)
146151
assert query_results == pipeline_results
147152
except FailedPrecondition as e:
148153
# if testing against a non-enterprise db, skip this check
@@ -1333,7 +1338,9 @@ def test_query_stream_w_simple_field_eq_op(query_docs, database, verify_pipeline
13331338

13341339

13351340
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1336-
def test_query_stream_w_simple_field_array_contains_op(query_docs, database, verify_pipeline):
1341+
def test_query_stream_w_simple_field_array_contains_op(
1342+
query_docs, database, verify_pipeline
1343+
):
13371344
collection, stored, allowed_vals = query_docs
13381345
query = collection.where(filter=FieldFilter("c", "array_contains", 1))
13391346
values = {snapshot.id: snapshot.to_dict() for snapshot in query.stream()}
@@ -1394,7 +1401,9 @@ def test_query_stream_w_simple_not_in_op(query_docs, database, verify_pipeline):
13941401

13951402

13961403
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1397-
def test_query_stream_w_simple_field_array_contains_any_op(query_docs, database, verify_pipeline):
1404+
def test_query_stream_w_simple_field_array_contains_any_op(
1405+
query_docs, database, verify_pipeline
1406+
):
13981407
collection, stored, allowed_vals = query_docs
13991408
num_vals = len(allowed_vals)
14001409
query = collection.where(
@@ -1532,7 +1541,9 @@ def test_query_stream_w_offset(query_docs, database, verify_pipeline):
15321541
)
15331542
@pytest.mark.parametrize("method", ["stream", "get"])
15341543
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1535-
def test_query_stream_or_get_w_no_explain_options(query_docs, database, method, verify_pipeline):
1544+
def test_query_stream_or_get_w_no_explain_options(
1545+
query_docs, database, method, verify_pipeline
1546+
):
15361547
from google.cloud.firestore_v1.query_profile import QueryExplainError
15371548

15381549
collection, _, allowed_vals = query_docs

packages/google-cloud-firestore/tests/system/test_system_async.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ async def _verifier(query):
181181
from google.cloud.firestore_v1.base_aggregation import BaseAggregationQuery
182182

183183
with subtests.test(msg="verify_pipeline"):
184-
185184
client = query._client
186185
if FIRESTORE_EMULATOR:
187186
pytest.skip("skip pipeline verification on emulator")
@@ -207,7 +206,10 @@ def _clean_results(results):
207206
query_results = _clean_results(
208207
list(
209208
itertools.chain.from_iterable(
210-
[[a._to_dict() for a in s] for s in await query.get()]
209+
[
210+
[a._to_dict() for a in s]
211+
for s in await query.get()
212+
]
211213
)
212214
)
213215
)
@@ -1311,7 +1313,9 @@ async def test_query_stream_w_simple_field_eq_op(query_docs, database, verify_pi
13111313

13121314

13131315
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1314-
async def test_query_stream_w_simple_field_array_contains_op(query_docs, database, verify_pipeline):
1316+
async def test_query_stream_w_simple_field_array_contains_op(
1317+
query_docs, database, verify_pipeline
1318+
):
13151319
collection, stored, allowed_vals = query_docs
13161320
query = collection.where(filter=FieldFilter("c", "array_contains", 1))
13171321
values = {snapshot.id: snapshot.to_dict() async for snapshot in query.stream()}
@@ -1336,7 +1340,9 @@ async def test_query_stream_w_simple_field_in_op(query_docs, database, verify_pi
13361340

13371341

13381342
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1339-
async def test_query_stream_w_simple_field_array_contains_any_op(query_docs, database, verify_pipeline):
1343+
async def test_query_stream_w_simple_field_array_contains_any_op(
1344+
query_docs, database, verify_pipeline
1345+
):
13401346
collection, stored, allowed_vals = query_docs
13411347
num_vals = len(allowed_vals)
13421348
query = collection.where(
@@ -1474,7 +1480,9 @@ async def test_query_stream_w_offset(query_docs, database, verify_pipeline):
14741480
)
14751481
@pytest.mark.parametrize("method", ["stream", "get"])
14761482
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1477-
async def test_query_stream_or_get_w_no_explain_options(query_docs, database, method, verify_pipeline):
1483+
async def test_query_stream_or_get_w_no_explain_options(
1484+
query_docs, database, method, verify_pipeline
1485+
):
14781486
from google.cloud.firestore_v1.query_profile import QueryExplainError
14791487

14801488
collection, _, allowed_vals = query_docs
@@ -1960,7 +1968,9 @@ async def test_collection_group_queries_startat_endat(client, cleanup, database)
19601968

19611969

19621970
@pytest.mark.parametrize("database", TEST_DATABASES_W_ENTERPRISE, indirect=True)
1963-
async def test_collection_group_queries_filters(client, cleanup, database, verify_pipeline):
1971+
async def test_collection_group_queries_filters(
1972+
client, cleanup, database, verify_pipeline
1973+
):
19641974
collection_group = "b" + UNIQUE_RESOURCE_ID
19651975

19661976
doc_paths = [

0 commit comments

Comments
 (0)