Add code quality test for self assignments

Is there a reason to only run these if PY3 is not true? If not, the PR I sent corrects this and tweaks a few other things, including the closing parenthesis.