Skip to content

Commit

Permalink
fix asyn test issues in py27
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Dec 5, 2024
1 parent 5610e4a commit 017d4c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions samples/snippets/deletes/deletes_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
TABLE_ID = f"mobile-time-series-deletes-async-{str(uuid.uuid4())[:16]}"


@pytest.fixture(scope="module")
def event_loop():
import asyncio
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()


@pytest_asyncio.fixture(scope="module", autouse=True)
async def table_id() -> AsyncGenerator[str, None]:
with create_table_cm(PROJECT, BIGTABLE_INSTANCE, TABLE_ID, {"stats_summary": None, "cell_plan": None}, verbose=False):
Expand Down
8 changes: 8 additions & 0 deletions samples/snippets/filters/filter_snippets_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
TABLE_ID = f"mobile-time-series-filters-async-{str(uuid.uuid4())[:16]}"


@pytest.fixture(scope="module")
def event_loop():
import asyncio
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()


@pytest_asyncio.fixture(scope="module", autouse=True)
async def table_id() -> AsyncGenerator[str, None]:
with create_table_cm(PROJECT, BIGTABLE_INSTANCE, TABLE_ID, {"stats_summary": None, "cell_plan": None}):
Expand Down

0 comments on commit 017d4c2

Please sign in to comment.