no-test-comments
Express test behavior in names and assertions instead of ordinary comments.
Why
Test prose can drift from the setup and assertion it describes; executable contracts keep the explanation checked.
Fix
Remove the comment, clarify the test or helper name, or express the invariant with an assertion. Preserve legal notices and required tool directives.
Examples
def test_save(): # A stale save is rejected. assert save_is_rejected()def test_stale_save_is_rejected(): assert save_is_rejected()def test_activation(): # Load current account profile activation settings # Build current account profile activation response load_current_account_profile_activation_settings() return build_current_account_profile_activation_response()def test_activation():
load_current_account_profile_activation_settings() return build_current_account_profile_activation_response()Autofix output
def test_activation():
load_current_account_profile_activation_settings() return build_current_account_profile_activation_response()