Make timeout duration unit self-documenting
まだ誰も着手していません。
評価
調査の方向性
まず、現在の @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
1200or0.00005have 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 はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-timeout のほかの issue
-
PR #200 introduced breaking change - `timeout` value in config is incompatible with older versions オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
pytest-dev/pytest-timeout#203 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#190 · コメント 9 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#189 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#181 · リアクション 4 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
pytest-dev/pytest-timeout#178 · コメント 1 件 ·
pytest-dev/pytest-timeout の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100