Skip to content

chore(deps): update dependency pytest-asyncio to v1 #13389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alloydb/notebooks/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ google-cloud-alloydb-connector[asyncpg]==1.5.0
sqlalchemy==2.0.40
pytest==8.3.3
ipykernel==6.29.5
pytest-asyncio==0.24.0
pytest-asyncio==1.0.0
nbconvert==7.16.6
2 changes: 1 addition & 1 deletion dialogflow-cx/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==8.2.0
pytest-asyncio==0.21.1
pytest-asyncio==1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This is a significant jump from pytest-asyncio==0.21.1 to 1.0.0. Versions of pytest-asyncio after 0.21.x (specifically around 0.23.x) had known issues regarding changes in event loop and fixture scope management that could break test suites previously working with 0.21.x. The release notes for v0.23.7 and v0.23.8 (included in this PR's description) explicitly warned about this and recommended staying on v0.21 if affected.

While these specific warnings are not present in the release notes for v0.25.0 onwards, indicating the issue might be resolved or mitigated, the large version leap warrants careful testing.

Could you please ensure that the tests in dialogflow-cx/, particularly streaming_detect_intent_infinite_test.py which uses @pytest.mark.asyncio, are thoroughly checked and pass with this new version? This is important to confirm that the test suite is not affected by the past behavior changes.

4 changes: 2 additions & 2 deletions firestore/cloud-async-client/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==8.2.0
pytest-asyncio==0.21.0; python_version > '3.6'
pytest-asyncio==0.16.0; python_version < '3.7'
pytest-asyncio==1.0.0; python_version > '3.6'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to the concern raised for dialogflow-cx, this update involves a significant jump from pytest-asyncio==0.21.0 to 1.0.0 (for Python > 3.6).

As mentioned, pytest-asyncio versions post-0.21.x (around 0.23.x) introduced changes to event loop and fixture scope handling that could potentially break existing test suites. The firestore/cloud-async-client/ directory contains extensive use of async tests (snippets_test.py, distributed_counters_test.py).

Given the substantial changes between 0.21.0 and 1.0.0, it's crucial to verify that these tests continue to function correctly. Please ensure thorough CI validation for this package.

pytest-asyncio==1.0.0; python_version < '3.7'
Comment on lines +2 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The updated pytest-asyncio==1.0.0 requires Python 3.8 or newer. The current version markers seem to be a carry-over from older pytest-asyncio versions and are now incompatible or misleading.

Specifically:

  1. pytest-asyncio==1.0.0; python_version > '3.6': This would attempt to install pytest-asyncio 1.0.0 on Python 3.7, where it's not supported.
  2. pytest-asyncio==1.0.0; python_version < '3.7': This line attempts to install pytest-asyncio 1.0.0 on Python versions older than 3.7 (e.g., 3.6), where it's also not supported. This will likely lead to installation errors in such environments.

Given that pytest==8.2.0 (also in this file) requires Python 3.8+, it's likely that Python versions older than 3.8 are no longer targeted for these tests.

Could we update these lines to accurately reflect the Python version compatibility of pytest-asyncio==1.0.0? A single line specifying python_version >= '3.8' would be appropriate.

pytest-asyncio==1.0.0; python_version >= '3.8'

flaky==3.8.1
2 changes: 1 addition & 1 deletion genai/controlled_generation/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion genai/count_tokens/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion genai/live/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.25.3
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion genai/model_optimizer/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion genai/template_folder/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion genai/thinking/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion genai/tools/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/chat_completions/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.24.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/embeddings/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/evaluation/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/extensions/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/function_calling/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.24.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/image_generation/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/model_garden/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/model_tuning/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/prompts/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/rag/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion generative_ai/reasoning_engine/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0
2 changes: 1 addition & 1 deletion model_garden/gemma/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
google-api-core==2.19.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-asyncio==1.0.0