You really need to use self.assertAlmostEqual for floats. Or numpy.testing.assert_array_almost_equal for numpy arrays.