Fix tests in python 2.x
Update for flask8 compliance.