python / python/mypy

Empty coverage report depending on mypy call location

Open
#9,931 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

hi,

to my understanding, there's a bug in mypy coverage report generation.
talking about the --html-report and --xml-report options (haven't tested the others).
if you call mypy from a folder parallel to the location of your sources folder, the files are analyzed properly but the report is empty.
no error is showing

steps to reproduce :

  • create a dummy module for mypy to analyse
  • create a folder next to your sources folder
  • call mypy ../src/mod/myfile.py --xml-report empty-report
  • look a the file index.xml and see that myfile.py is not listed

conversely if you call mypy from the source folder, you get a proper report

see attached files for an example.

mypy-report-bug.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report-generation issue by running mypy ../src/mod/myfile.py --xml-report empty-report from a folder parallel to the source folder, then compare it with a run from the source folder. Start with the --xml-report and --html-report entry points and inspect index.xml; done means the analyzed file appears in the generated report in both locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.