[Numpy-discussion] (no subject)
Fri Jan 20 05:53:04 CST 2012
Not sure if there's a better way, but you can do it with
assert not numpy.allclose(numpy_result, result)
2012/1/20 Hänel Nikolaus Valentin <firstname.lastname@example.org>
> I would like to make a sanity test to check that calling the same
> function with different parameters actually gives different results.
> I am currently using::
> npt.assert_almost_equal(numpy_result, result)
> except AssertionError:
> assert True
> assert False
> But maybe you have a better way? I couldn't find a 'assert_not_equal'
> and the above just feels stupid.
> thanks for your advice.
> Valentin Hänel
> Scientific Software Developer
> Blue Brain Project http://bluebrain.epfl.ch/
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion