Fixed python3 issue and deprecated assertion method