On Tue, 22 Dec 2020 19:32:15 +0000 David Mertz <me...@gnosis.cx> wrote: > > If you know you might be dealing with NumPy arrays (as the import > suggests), I think it's simply right to spell it as: > > unittest.TestCase().assertTrue(np.array_equal([1., 2., 3.], np.array([1., > 2., 3.])))
Please don't suggest this, it will produce unhelpful error messages (do you like "False is not true" errors in CI builds?). The better solution is to use the dedicated assertions in the `numpy.testing` package: https://numpy.org/doc/stable/reference/routines.testing.html Regards Antoine. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/JIVB4CCRKPYEISJLHPGHPWY2EAD4PDH5/ Code of Conduct: http://python.org/psf/codeofconduct/