Remove obsolete imports
Rename duplicate test functions
Some (mainly automatic) PEP 8 formatting changes