fixed test and flake8