Skip to content

pyrefly coverage reports methods and attributes of deleted classes #4021

Description

@jorenham

Similar to #3576, parse_classes skips a deleted class, but its methods and instance attributes stay in the report as dangling symbols:

class Gone:
    def method(self, x):
        pass
    def __init__(self):
        self.attr = 1

del Gone
 WARN `Gone.method` is untyped [coverage-missing]
 --> del_class.py:2:5
  |
2 | /     def method(self, x):
3 | |         pass
  | |____________-
  |
 WARN `Gone.attr` is untyped [coverage-missing]
 --> del_class.py:5:14
  |
5 |         self.attr = 1
  |              ----
  |
ERROR type coverage 0.00% (0 of 3 typable) is below the 100.00% threshold

this should have passed with 0/0 typable.

Metadata

Metadata

Assignees

Labels

coverageIssues related to `pyrefly coverage`, `pyrefly report`quansight

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions