Not sure if there's a better way, but you can do it with assert not numpy.allclose(numpy_result, result)
-=- Olivier 2012/1/20 Hänel Nikolaus Valentin <valentin.hae...@epfl.ch> > Hi, > > 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:: > > try: > npt.assert_almost_equal(numpy_result, result) > except AssertionError: > assert True > else: > 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. > > V- > > -- > Valentin Hänel > Scientific Software Developer > Blue Brain Project http://bluebrain.epfl.ch/ > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion