PEP8 + refactoring for test file.