CFY-661 fixed tests and flake8