The indentation here looks fine to me (`pep8` didn't complain about a mixture of tabs and spaces).  This line, the assertRaises, isn't meant to be part of func().