WTE: python 2 compatibility + tests