Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error for in-place operations on result #144

Open
jamescooke opened this issue May 2, 2020 · 0 comments
Open

Add error for in-place operations on result #144

jamescooke opened this issue May 2, 2020 · 0 comments
Labels
type:feature New feature or request

Comments

@jamescooke
Copy link
Owner

jamescooke commented May 2, 2020

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

@jamescooke jamescooke added the type:feature New feature or request label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant