Skip to content

Conversation

@mryab
Copy link
Member

@mryab mryab commented Apr 20, 2025

This PR upgrades pytest_asyncio, following the migration guide given in the plugin documentation

@codecov
Copy link

codecov bot commented Apr 20, 2025

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.38%. Comparing base (d20e810) to head (ad55ef1).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
hivemind/utils/asyncio.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #652      +/-   ##
==========================================
- Coverage   85.39%   85.38%   -0.01%     
==========================================
  Files          81       96      +15     
  Lines        8006     8583     +577     
==========================================
+ Hits         6837     7329     +492     
- Misses       1169     1254      +85     
Files with missing lines Coverage Δ
hivemind/p2p/p2p_daemon.py 96.44% <100.00%> (+0.86%) ⬆️
hivemind/p2p/p2p_daemon_bindings/control.py 91.82% <100.00%> (+0.22%) ⬆️
hivemind/utils/asyncio.py 96.37% <88.88%> (-3.63%) ⬇️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mryab mryab requested review from dvmazur and justheuristic May 6, 2025 04:47
yield ret_value


def cancel_task_if_running(task: Optional[asyncio.Task]) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

This is introduced to make sure we don't run into errors when trying to cancel tasks with a closed event loop. In particular, this might happen in tests once we remove the current event_loop fixture, which seems to be recommended as per the migration guide

Copy link
Member

@justheuristic justheuristic left a comment

Choose a reason for hiding this comment

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

LGTM

@mryab mryab merged commit 4d5c414 into master May 6, 2025
31 of 37 checks passed
@mryab mryab deleted the upgrade-asyncio branch May 6, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants