You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common mistake is to write asserts with a message as the only parameter.
For example: assert "unreachable code"
instead of: assert False, "unreachable code"
In the malformed case, the string will evaluate as True and the assertion will never hit.
Could Pylint warn if an assert has a string literal as the first parameter?
The text was updated successfully, but these errors were encountered:
This check is emitted whenever **pylint** finds an assert statement
with a string literal as its first argument. Such assert statements
are probably unintended as they will always pass.
Close#3284
A common mistake is to write asserts with a message as the only parameter.
For example:
assert "unreachable code"
instead of:
assert False, "unreachable code"
In the malformed case, the string will evaluate as
True
and the assertion will never hit.Could Pylint warn if an assert has a string literal as the first parameter?
The text was updated successfully, but these errors were encountered: