You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add missing test coverage for asyncio.graph #148701
Code coverage analysis of Lib/asyncio/graph.py reveals several uncovered branches and error-handling blocks. We need to add tests for the following scenarios in test_asyncio/test_graph.py:
Invalid Types:
Triggering TypeError by passing a non-Future object to capture_call_graph() and _build_graph_for_future().
Context Errors & Fallbacks:
Triggering RuntimeError by calling capture_call_graph() outside of a running event loop without providing a future.
Returning None from capture_call_graph() (and subsequently "" from format_call_graph()) when called inside a running event loop, but not within an active task (when no future is provided).
The limit Parameter:
Testing the truncation logic using both positive and negative limit values in capture_call_graph() and _build_graph_for_future().
Generator Introspection:
Hitting the elif hasattr(coro, 'ag_await') branch in _build_graph_for_future() to test ag_await traversal.
Formatting standard (synchronous) generators in format_call_graph() to test the except AttributeError fallback that accesses gi_frame and gi_code.
Activity
pythongh-148701: Add missing test coverage for asyncio.graph
gh-148701: Add missing test coverage for asyncio.graph (#148702)