Update tests due to changes in autopep8
Handle encoding declarations in Python 2

See PEP 263.