Skip to content

Print uncovered lines #691

Open
Open

Description

@gsganden

--cov-report=term-missing tells us which line numbers aren’t covered, but you still have to open the file to see the actual code. Could we add a flag (something like --show-code) that prints the uncovered lines themselves right after the tests finish?

This feature would be particularly useful for using code-gen tools to fill testing gaps because LLM-based tools are not good at finding lines by number (https://gandenberger.org/posts/2025-05-07_llm-test-coverage/). It would also mimic how many linting tools such ruff behave.

I'd be happy to contribute a pull request if there is interest.

Activity

  1. webknjaz commented on Aug 18, 2025

    @webknjaz
    Member

    This sounds out of the scope with machine-readable formats (xml/json/lcov) already being supported. But perhaps --cov-report annotate will help you.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions