Does not consult files at project root
@DawnofGenX がすでに取り組んでいます。
2026年10月6日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- testing-qa
調査の方向性
Start by reproducing the configuration and .coverage differences from the project root and from ./tests/, using the listed pytest, pytest-cov, and coverage versions. Trace how pytest-cov locates pyproject.toml and chooses the coverage output path; done means both invocations use the project-root configuration and place .coverage consistently.
索引モデルが issue の本文から書いたものです。
説明
Summary
If pytest runs in e.g. ./tests/, it reads ../pyproject.toml for configuration options, and that squares with my expectation. pytest-cov does seem to look only for ./pyproject.toml (and also writes ./.coverage instead of keeping that file at the project root), and that causes it to run with different settings depending on where pytest is invoked.
Case in point, I have this in my config:
[tool.coverage.report]
exclude_also = [
'def __repr__',
]
If I run pytest from the project root directory, I get 100% coverage. If I run it from the tests/ subdirectory, all __repr__ functions, which I don't test, get reports as uncovered.
Reproducer
Versions
pytest 8.3.5
pytest-cov 6.1.1
coverage 7.8.0
Python 3.13.3
- 主要言語
- Python
- スター
- 2.1k
- フォーク
- 253
- 平均マージ
- 12日 4時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-cov のほかの issue
-
Celery tests require package; test blows up if Celery not installed instead of skipping the tests gracefully対応中かも @dchaudhari7177 が 95 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pytest-dev/pytest-cov#750 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pytest-dev/pytest-cov#617 · コメント 1 件 ·
-
Only set dynamic context on coveragepy cores supporting it, perhaps?対応中かも @terminalchai が 9 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pytest-dev/pytest-cov#755 · コメント 3 件 ·
-
INTERNALERROR when generating html report using pytest-cov 7.1.0 with jinja対応中かも @daleselaji-dev が 81 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
pytest-dev/pytest-cov#748 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
pytest-dev/pytest-cov#747 · リアクション 1 件 ·
pytest-dev/pytest-cov の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ClockGU/clockwork-backend#169 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws-samples/sample-per-model-bedrock#616 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
chnm/teachinghistory-hugo#47 ·
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
pandas-dev/pandas-stubs#2047 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信