Check that every test function asserts something
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
Read step 2.7 of the code-quality plan and inspect rules/registry.toml for how ratcheted rules are registered. Then review existing rule implementations, tests under scripts/rules/tests/, and the 22 baseline cases described in the issue. Done means the rule detects the listed assertion forms and helper calls, records current exceptions in a baseline under rules/baselines/, and the baseline can only shrink; pull request #4188 is already open.
索引モデルが issue の本文から書いたものです。
説明
What
Add a quality guard that fails on any test function that checks nothing: one that contains no assert, no pytest.raises (or pytest.warns, pytest.fail), no unittest self.assert... or self.fail, no mock assert_called... or other call to an assert... function, no raise AssertionError, and no call to a helper that does one of these. Today's tests that check nothing go in a baseline file under rules/baselines/, which can only shrink.
Why
A test without a check passes whatever the code returns, as long as nothing raises. Of the 3,013 test functions in tests/ and scripts/rules/tests/, 22 check nothing today, for example tests/unit/test_warmup.py::test_run_startup_warmup_swallows_calculate_errors. Most of these only show that a call doesn't raise. They pass even if the call returns the wrong value.
This is the "every test function asserts something" check in step 2.7 of the code-quality plan, registered in rules/registry.toml as a ratcheted rule.
- 主要言語
- Python
- スター
- 18
- フォーク
- 33
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 93
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PolicyEngine/policyengine-api のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PolicyEngine/policyengine-api#4037 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
PolicyEngine/policyengine-api#3911 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
PolicyEngine/policyengine-api#3910 ·
メンテナーはふだん 2 日以内に返信
-
Assign every v2 route and service file to a layer and enforce the doc-only v2 layer rules対応中かも @anth-volk が今日担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
PolicyEngine/policyengine-api#4190 ·
メンテナーはふだん 2 日以内に返信
-
Check that every noqa and type: ignore comment names a code and gives a reason対応中かも @anth-volk が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
PolicyEngine/policyengine-api#4182 ·
メンテナーはふだん 2 日以内に返信
PolicyEngine/policyengine-api の issue をすべて見る
似ている issue
-
area:docs documentation effort:M ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
mczielinski/ob-analytics#423 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gke-labs/kube-agents#4838 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
danyuchn/asd-ste100-skill#60 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 64/100
Gathin23/cleanyourtv#3299 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
autowarefoundation/autoware_carla_scenario#1485 ·
メンテナーはふだん 1 日以内に返信