GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add missing test coverage for asyncio.graph · Issue #148701 · python/cpython

Add missing test coverage for asyncio.graph #148701

New issue
Copy link
New issue
Copy link
Closed
Closed
Add missing test coverage for asyncio.graph#148701
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-asynciotype-featureA feature request or enhancementA feature request or enhancement

Description

@ashm-dev
ashm-dev
opened on Apr 17, 2026
Issue body actions

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:

  1. Invalid Types:
    • Triggering TypeError by passing a non-Future object to capture_call_graph() and _build_graph_for_future().
  2. 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).
  3. The limit Parameter:
    • Testing the truncation logic using both positive and negative limit values in capture_call_graph() and _build_graph_for_future().
  4. 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.

Linked PRs

  • gh-148701: Add missing test coverage for asyncio.graph #148702

Activity

  1. StanFromIreland
    added
    type-featureA feature request or enhancementA feature request or enhancement
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-asyncio
    on Apr 17, 2026
  2. github-project-automation
    added this to asyncioon Apr 17, 2026
  3. github-project-automation
    moved this to Todo in asyncioon Apr 17, 2026
  4. ashm-dev
    added a commit that references this issue on Apr 17, 2026

    pythongh-148701: Add missing test coverage for asyncio.graph

    c5a5fbc
  5. kumaraditya303
    added a commit that references this issue on May 12, 2026

    gh-148701: Add missing test coverage for asyncio.graph (#148702)

    a043b0e
  6. kumaraditya303
    closed this as completedon May 12, 2026
  7. github-project-automation
    moved this from Todo to Done in asyncioon May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirTests in the Lib/test dirtopic-asynciotype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • asyncio
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.