Remove Python >= 2.7 syntax from tests