Skip to content

Erroneous coverage indication in html report when type checking stops due to impossible assert #2785

Closed
@axch

Description

@axch

The html report for checking coverage of the situation from Issue #2776 misrepresents the unchecked code lines. Specifically, the example is

class A(object): pass

class C(object): pass

def bar(x):
    # type: (A) -> None
    reveal_type(x)
    assert isinstance(x, C)
    reveal_type(x)

The report generated by --html-report indicates that the whole file is covered, even though the second reveal_type produces no output (which problem itself is #2776). Inspecting the source indicates that the second reveal_type is classified as "line-empty", which visually looks like "line-precise", and in this circumstance is misleading.

Metadata

Metadata

Assignees

Labels

bugmypy got something wrong

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions