23 Dec
2020
23 Dec
'20
1:09 a.m.
On Tue, 22 Dec 2020 19:32:15 +0000
David Mertz
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.