Skip to content

Commit 017d4c2

Browse files
committed
fix asyn test issues in py27
1 parent 5610e4a commit 017d4c2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

samples/snippets/deletes/deletes_async_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
TABLE_ID = f"mobile-time-series-deletes-async-{str(uuid.uuid4())[:16]}"
3131

3232

33+
@pytest.fixture(scope="module")
34+
def event_loop():
35+
import asyncio
36+
loop = asyncio.get_event_loop_policy().new_event_loop()
37+
yield loop
38+
loop.close()
39+
40+
3341
@pytest_asyncio.fixture(scope="module", autouse=True)
3442
async def table_id() -> AsyncGenerator[str, None]:
3543
with create_table_cm(PROJECT, BIGTABLE_INSTANCE, TABLE_ID, {"stats_summary": None, "cell_plan": None}, verbose=False):

samples/snippets/filters/filter_snippets_async_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
TABLE_ID = f"mobile-time-series-filters-async-{str(uuid.uuid4())[:16]}"
3535

3636

37+
@pytest.fixture(scope="module")
38+
def event_loop():
39+
import asyncio
40+
loop = asyncio.get_event_loop_policy().new_event_loop()
41+
yield loop
42+
loop.close()
43+
44+
3745
@pytest_asyncio.fixture(scope="module", autouse=True)
3846
async def table_id() -> AsyncGenerator[str, None]:
3947
with create_table_cm(PROJECT, BIGTABLE_INSTANCE, TABLE_ID, {"stats_summary": None, "cell_plan": None}):

0 commit comments

Comments
 (0)