pep8
remove unused import.
Update test that now the error is raised earlier.