no-statically-truthy-assertion
An assertion condition is statically truthy, including deferred expressions and test-local scalar setup.
Why
A condition that stays truthy whenever evaluation succeeds cannot reject an incorrect result and often means the intended condition was wrapped in a container, deferred without execution, or placed in the message slot.
Fix
Assert an explicit runtime-derived condition. If the test only requires an operation not to raise, evaluate it directly and retain any meaningful follow-up assertion. Consume generator values or call the lambda when their result is the contract; choose empty-input behavior explicitly.
Examples
def test_service(response): assert True, response.status_code == 200def test_service(response): assert response.status_code == 200def test_values(rows): checks = (row.is_valid for row in rows) assert checksdef test_values(rows): checks = (row.is_valid for row in rows) assert all(checks)def test_service(): status = "ok" assert status == "ok"def test_service(): status = service_status() assert status == "ok"Formerly: no-tautological-expect