Just use `self.assertAlmostEqual`: it's a lot clearer and simpler than what you're doing here.