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

Make timeout duration unit self-documenting

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
testing

調査の方向性

まず、現在の @mark.timeout API と、その期間の単位を定義しているドキュメントを確認します。提案されているキーワード引数インターフェースと timedelta インターフェースを、互換性とサポートされる単位を含めて比較します。動作と移行への影響が明確に文書化された、自己説明的な API を選定して仕様化できれば完了です。

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

説明

In a statement like @mark.timeout(50) there is nothing to say the duration is defined in seconds. This has a few disadvantages:

  • Many other timing mechanisms use milliseconds or minutes as their units, so we can't simply assume that it's seconds. A new or returning user has to read the documentation (or code) to ascertain this, wasting time and producing cognitive overhead.
  • Extreme timeouts like 1200 or 0.00005 have more cognitive overhead, since converting to the "natural" unit of minutes/microseconds etc isn't always trivial.

It would be nice if it instead were self-documenting. Some alternatives:

  • @mark.timeout(seconds=50) would make it pretty obvious, and would make it easy to support several units.
  • @mark.timeout(timedelta(minutes=5)) would make it more explicit, while supporting the widest possible range of units at no extra cost.
  • @mark.timeout(seconds=timedelta(minutes=5).total_seconds()) is a clunky workaround.
主要言語
Python
スター
258
フォーク
69
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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