Replace assertEqual(type(x), y) with assertIsInstance(x, y)