python / python/mypy

Unclear Coverage Results

Offen
#18,926 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug pending
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Describe the bug
Coverage report with mypy is not clear and not descriptive

To Reproduce
When using mypy report or coverage on pytest the result I'm seeing is not clear

Missing 1-6 4-7 8-7 main.py

This result only shows me the lines with the problem but not what is the problem

The closest I've gotten to seeing the full issue is when using the --report in mypy or other libraries and using html

Mypy src --html-report test

When inspecting the elements I can see issues like any type not recognized or unannotated type set, but the line is usually not correct as it might be related to the definition of the var

var: Var = some_untyped_function()

var.element <---- line that failes

What can I do to make the error clearer, see exactly what failed and how to fix it if possible

Also for reference I opened the same issue in the pycoverage repository and they're saying it might be a mypy thing

https://github.com/nedbat/coveragepy/issues/1948

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die gemeldete Ausgabe mit mypy und dem Coverage-Bericht für das Beispiel mit main.py zu reproduzieren, und vergleiche sie dann mit der Ausgabe von --html-report. Bestimme, ob die Diagnose auf die tatsächliche Quelle des nicht typisierten oder nicht annotierten Werts verweist; done soll bedeuten, dass der Bericht den fehlerhaften Typ und die relevante Stelle eindeutig identifiziert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.