Switch assert method for python 3