pytest-assert_match-after-path-patch
sync-sleep-in-async-code
unchecked-subprocess-call
baseclass-attribute-override
and
F`; one of these methods will be overwritten.file-object-redefined-before-close
uncaught-executor-exceptions
for _ in $EXECUTOR.map(...): pass
.return-in-init
return
should never appear inside a class init function. This will cause a runtime error.yield-in-init
yield
should never appear inside a class init function. This will cause a runtime error.list-modify-while-iterate
$LIST
is a list that is being modified while in a for loop. This will likely cause a runtime error or an infinite loop.use-sys-exit
exit
. Use sys.exit
over the python shell exit
built-in. exit
is a helper for the interactive shell and may not be available on all Python implementations.writing-to-file-in-read-mode
no-strings-as-booleans
"one" and "two"
will return “two”. "one" or "two"
will return “one”. In Python, strings are truthy, and strings with a non-zero length evaluate to True.test-is-missing-assert
assert
keyword.dict-del-while-iterate
$DICT[$KEY]
is a dict with items being deleted while in a for loop. This is usually a bad idea and will likely lead to a RuntimeError: dictionary changed size during iterationcannot-cache-generators
pdb-remove
useless-eqeq
$X == $X
or $X != $X
. If testing for floating point NaN, use math.isnan($X)
, or cmath.isnan($X)
if the number is complex.