diff --git a/.librarian/generator-input/client-post-processing/bigtable-integration.yaml b/.librarian/generator-input/client-post-processing/bigtable-integration.yaml index 09593bdefc30..2953a7f52135 100644 --- a/.librarian/generator-input/client-post-processing/bigtable-integration.yaml +++ b/.librarian/generator-input/client-post-processing/bigtable-integration.yaml @@ -417,7 +417,7 @@ replacements: "google-cloud-testutils", ] SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [ - "pytest-asyncio==0.21.2", + "pytest-asyncio>=0.26.0", "pytest-order==1.3.0", RUFF_VERSION, "pyyaml==6.0.2", diff --git a/packages/google-cloud-bigtable/noxfile.py b/packages/google-cloud-bigtable/noxfile.py index 8f68486cd3a3..88d0237720fa 100644 --- a/packages/google-cloud-bigtable/noxfile.py +++ b/packages/google-cloud-bigtable/noxfile.py @@ -57,7 +57,7 @@ "google-cloud-testutils", ] SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [ - "pytest-asyncio==0.21.2", + "pytest-asyncio>=0.26.0", "pytest-order==1.3.0", RUFF_VERSION, "pyyaml==6.0.2", diff --git a/packages/google-cloud-bigtable/tests/system/conftest.py b/packages/google-cloud-bigtable/tests/system/conftest.py index e9cb2fcc91e8..7a7b315ec542 100644 --- a/packages/google-cloud-bigtable/tests/system/conftest.py +++ b/packages/google-cloud-bigtable/tests/system/conftest.py @@ -15,19 +15,8 @@ Import pytest fixtures for setting up table for data client system tests """ -import asyncio import os import sys -import pytest - script_path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(script_path) - - -@pytest.fixture(scope="session") -def event_loop(): - loop = asyncio.new_event_loop() - yield loop - loop.stop() - loop.close() diff --git a/packages/google-cloud-bigtable/tests/system/pytest.ini b/packages/google-cloud-bigtable/tests/system/pytest.ini new file mode 100644 index 000000000000..ae7833d23bf6 --- /dev/null +++ b/packages/google-cloud-bigtable/tests/system/pytest.ini @@ -0,0 +1,8 @@ +[pytest] +# The data client system tests share a single client across the whole session +# (see the session-scoped `client`/`target`/`table` fixtures), so every async +# fixture and test must run on the same event loop. Run them all on a single +# session-scoped loop, matching the previous session-scoped `event_loop` +# override that pytest-asyncio removed in 1.0. +asyncio_default_test_loop_scope = session +asyncio_default_fixture_loop_scope = session