Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Does not consult files at project root

オープン
#692 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

@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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pytest-dev/pytest-cov のほかの issue

pytest-dev/pytest-cov の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。