Clean up pep8 errors and some deprecated statements
Adds changes from PR feedback
Merge pull request #1379 from willingc/test-linelength

Cleaned tests file to correct all pyflakes and pep8 errors