pytest.ini wins even when it's empty, and `.pytest.ini` is never read

オープン 初心者向け
#159 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, typescript

調査の方向性

まず readPytestSettings と PROJECT_FILES を読み、次に CONTRIBUTING.md に記載された合成 fixture のテストを探してください。空の pytest.ini が pyproject.toml より優先される fixture と、.pytest.ini が python_files を設定する fixture を追加し、npm test を実行してください。両方のケースが通り、.pytest.ini だけで Python プロジェクトとして検出されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

adapter bug good first issue

pytest's rule: pytest.ini "will always match and take precedence … even if empty", and it matches even without a [pytest] section. The hidden .pytest.ini works the same way. Only pyproject.toml, tox.ini and setup.cfg need their section to match. The first match wins, and options are never merged.

readPytestSettings skips any file without the section (if (!section) continue;) and never looks at .pytest.ini. So:

  • With a pytest.ini that has only a comment, plus a pyproject.toml that sets python_files = ["check_*.py"], DiffCI uses check_*.py. pytest uses its defaults, test_*.py and *_test.py. DiffCI then doesn't see test_x.py as a test.
  • With only a .pytest.ini that sets python_files = check_*.py, DiffCI uses the defaults and doesn't see check_x.py as a test.

Done when:

  • The search order is pytest.ini, .pytest.ini, then pyproject.toml, tox.ini and setup.cfg.
  • An existing pytest.ini or .pytest.ini stops the search, even without a [pytest] section. pytest's defaults apply when it has no section.
  • .pytest.ini is added to PROJECT_FILES, so a repository whose only pytest file is .pytest.ini is detected as a Python project.
  • There is a test for each of the two cases above.

New to DiffCI? See CONTRIBUTING.md: add a synthetic fixture, run npm test, and sign off commits with git commit -s. Comment here to claim the issue.

主要言語
TypeScript
スター
0
フォーク
4
平均マージ
18時間 41分
マージ済み PR(30日)
48

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

DiffCI/core のほかの issue

DiffCI/core の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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