Cleaned tests file to correct all pyflakes and pep8 errors

Would also like this } to have its own line