Cleaned tests file to correct all pyflakes and pep8 errors

(psst did you get the reference that this is to Randall P. Munroe?)