Coverage not working with mypy ignores and vague errors
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Bug Report
(A clear and concise description of what the bug is.)
Coverage not showing the same result as mypy
To Reproduce
class A(BaseModel):
b: str = Field(default=..., description="some var")
Expected Behavior
To get the code coverage based on what I get with the mypy src call
Actual Behavior
I'm getting low coverage despite mypy not complaining after these ignores
Ignore missing imports and no warn unused ignores just doesnt apply to coverage, it shows passed when using mypy src but fails on coverage
Your Environment
- Mypy version used: latest
- Mypy command-line flags: mypy
--disallow-untyped-calls
--disallow-untyped-defs
--check-untyped-defs
--follow-imports=normal
--explicit-package-bases
--allow-untyped-globals
--ignore-missing-imports
--no-warn-unused-ignores
--warn-return-any
. - Mypy configuration options from
mypy.ini(and other config files): - Python version used: 3.13.2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された Python スニペットと記載された mypy のコマンドラインフラグを使って報告を再現し、その後、通常の mypy の結果と coverage の結果を比較します。issue では実装ファイルもテストも指定されていないため、先に coverage のエントリーポイントと既存の coverage テストを見つけてください。mypy と coverage の間で、無視された import と未使用の ignore の扱いが一貫していれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- testing-qa
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100