Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 4c78093

Browse files
committed
Fixed system test failure at the end of a test run
1 parent 5891cc7 commit 4c78093

5 files changed

Lines changed: 26 additions & 33 deletions

File tree

tests/system/admin_overlay/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@pytest.fixture(scope="session")
2424
def admin_overlay_project_id():
2525
_, default_project = google.auth.default()
26-
yield os.getenv("ADMIN_TEST_PROJECT") or default_project
26+
yield os.getenv("GOOGLE_CLOUD_PROJECT") or default_project
2727

2828

2929
def generate_unique_suffix(name):

tests/system/admin_overlay/test_system_async.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
from datetime import datetime, timedelta
3838

39-
import asyncio
4039
import pytest
4140

4241

@@ -49,16 +48,6 @@
4948
__CROSS_SYNC_OUTPUT__ = "tests.system.admin_overlay.test_system_autogen"
5049

5150

52-
@CrossSync.drop
53-
@pytest.fixture(scope="session")
54-
def event_loop():
55-
loop = asyncio.new_event_loop()
56-
asyncio.set_event_loop(loop)
57-
yield loop
58-
loop.stop()
59-
loop.close()
60-
61-
6251
@CrossSync.convert
6352
@CrossSync.pytest_fixture(scope="session")
6453
async def data_client(admin_overlay_project_id):

tests/system/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,20 @@
1717
import sys
1818
import os
1919

20+
import pytest
21+
import asyncio
22+
2023
script_path = os.path.dirname(os.path.realpath(__file__))
2124
sys.path.append(script_path)
2225

2326
pytest_plugins = [
2427
"data.setup_fixtures",
2528
]
29+
30+
31+
@pytest.fixture(scope="session")
32+
def event_loop():
33+
loop = asyncio.get_event_loop()
34+
yield loop
35+
loop.stop()
36+
loop.close()

tests/system/data/test_system_async.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ async def table(self, client, table_id, instance_id):
9898
async with client.get_table(instance_id, table_id) as table:
9999
yield table
100100

101-
@CrossSync.drop
102-
@pytest.fixture(scope="session")
103-
def event_loop(self):
104-
loop = asyncio.get_event_loop()
105-
yield loop
106-
loop.stop()
107-
loop.close()
108101

109102
@pytest.fixture(scope="session")
110103
def column_family_config(self):

tests/system/data/test_system_autogen.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_mutation_set_cell(self, table, temp_rows):
200200
"""Ensure cells can be set properly"""
201201
row_key = b"bulk_mutate"
202202
new_value = uuid.uuid4().hex.encode()
203-
(row_key, mutation) = self._create_row_and_mutation(
203+
row_key, mutation = self._create_row_and_mutation(
204204
table, temp_rows, new_value=new_value
205205
)
206206
table.mutate_row(row_key, mutation)
@@ -233,7 +233,7 @@ def test_bulk_mutations_set_cell(self, client, table, temp_rows):
233233
from google.cloud.bigtable.data.mutations import RowMutationEntry
234234

235235
new_value = uuid.uuid4().hex.encode()
236-
(row_key, mutation) = self._create_row_and_mutation(
236+
row_key, mutation = self._create_row_and_mutation(
237237
table, temp_rows, new_value=new_value
238238
)
239239
bulk_mutation = RowMutationEntry(row_key, [mutation])
@@ -268,11 +268,11 @@ def test_mutations_batcher_context_manager(self, client, table, temp_rows):
268268
"""test batcher with context manager. Should flush on exit"""
269269
from google.cloud.bigtable.data.mutations import RowMutationEntry
270270

271-
(new_value, new_value2) = [uuid.uuid4().hex.encode() for _ in range(2)]
272-
(row_key, mutation) = self._create_row_and_mutation(
271+
new_value, new_value2 = [uuid.uuid4().hex.encode() for _ in range(2)]
272+
row_key, mutation = self._create_row_and_mutation(
273273
table, temp_rows, new_value=new_value
274274
)
275-
(row_key2, mutation2) = self._create_row_and_mutation(
275+
row_key2, mutation2 = self._create_row_and_mutation(
276276
table, temp_rows, new_value=new_value2
277277
)
278278
bulk_mutation = RowMutationEntry(row_key, [mutation])
@@ -293,7 +293,7 @@ def test_mutations_batcher_timer_flush(self, client, table, temp_rows):
293293
from google.cloud.bigtable.data.mutations import RowMutationEntry
294294

295295
new_value = uuid.uuid4().hex.encode()
296-
(row_key, mutation) = self._create_row_and_mutation(
296+
row_key, mutation = self._create_row_and_mutation(
297297
table, temp_rows, new_value=new_value
298298
)
299299
bulk_mutation = RowMutationEntry(row_key, [mutation])
@@ -315,12 +315,12 @@ def test_mutations_batcher_count_flush(self, client, table, temp_rows):
315315
"""batch should flush after flush_limit_mutation_count mutations"""
316316
from google.cloud.bigtable.data.mutations import RowMutationEntry
317317

318-
(new_value, new_value2) = [uuid.uuid4().hex.encode() for _ in range(2)]
319-
(row_key, mutation) = self._create_row_and_mutation(
318+
new_value, new_value2 = [uuid.uuid4().hex.encode() for _ in range(2)]
319+
row_key, mutation = self._create_row_and_mutation(
320320
table, temp_rows, new_value=new_value
321321
)
322322
bulk_mutation = RowMutationEntry(row_key, [mutation])
323-
(row_key2, mutation2) = self._create_row_and_mutation(
323+
row_key2, mutation2 = self._create_row_and_mutation(
324324
table, temp_rows, new_value=new_value2
325325
)
326326
bulk_mutation2 = RowMutationEntry(row_key2, [mutation2])
@@ -347,12 +347,12 @@ def test_mutations_batcher_bytes_flush(self, client, table, temp_rows):
347347
"""batch should flush after flush_limit_bytes bytes"""
348348
from google.cloud.bigtable.data.mutations import RowMutationEntry
349349

350-
(new_value, new_value2) = [uuid.uuid4().hex.encode() for _ in range(2)]
351-
(row_key, mutation) = self._create_row_and_mutation(
350+
new_value, new_value2 = [uuid.uuid4().hex.encode() for _ in range(2)]
351+
row_key, mutation = self._create_row_and_mutation(
352352
table, temp_rows, new_value=new_value
353353
)
354354
bulk_mutation = RowMutationEntry(row_key, [mutation])
355-
(row_key2, mutation2) = self._create_row_and_mutation(
355+
row_key2, mutation2 = self._create_row_and_mutation(
356356
table, temp_rows, new_value=new_value2
357357
)
358358
bulk_mutation2 = RowMutationEntry(row_key2, [mutation2])
@@ -378,11 +378,11 @@ def test_mutations_batcher_no_flush(self, client, table, temp_rows):
378378

379379
new_value = uuid.uuid4().hex.encode()
380380
start_value = b"unchanged"
381-
(row_key, mutation) = self._create_row_and_mutation(
381+
row_key, mutation = self._create_row_and_mutation(
382382
table, temp_rows, start_value=start_value, new_value=new_value
383383
)
384384
bulk_mutation = RowMutationEntry(row_key, [mutation])
385-
(row_key2, mutation2) = self._create_row_and_mutation(
385+
row_key2, mutation2 = self._create_row_and_mutation(
386386
table, temp_rows, start_value=start_value, new_value=new_value
387387
)
388388
bulk_mutation2 = RowMutationEntry(row_key2, [mutation2])

0 commit comments

Comments
 (0)