jamescooke/flake8-aaa

Spacing between Act and Assert is not checked correctly when a "#" comment is before the Assert block

Closed this issue · 1 comments

def test_make_no_role(couchbase_default_database):
    """
    Creates everything except role if False
    """
    result = ProjectMembershipBizFactory(role=False)

    # Account has been written to couchbase, no role has been created
    document = result.project_membership_couchbase.account_couchbase.account_permissions_document.document
    assert document in couchbase_default_database.all_docs()

Leaving aside the discussion about whether the # comment is in the appropriate place, this test should not trigger a AAA04 code.

Fixed as of #59 , good example test is here:

def test_comment_before_assert():
x = 1
y = 2
result = x + y
# Always 2
assert result == 2