jamescooke/flake8-aaa

Add error for in-place operations on result

jamescooke opened this issue · 0 comments

Example:

def test_addition():
    result = 1 + 1

    assert result == 2
    result += 1
    assert result == 3
    result /= 3
    assert result == 1

Expected error:

AAA0x: Additional operations on result (2)

Resolution doc will advise: Squash into Act or extract to separate test(s).

See also: https://docs.python.org/3.8/library/operator.html#in-place-operators