Using built-in unittest module works okay for nested array (deep equality) using Python 3.10.12
self.assertEqual([
["1","0","1","1","0","1","1"]
], [
["1","0","1","1","0","1","x"]
])
and it prints a nice output message for failure.
First differing element 0:
['1', '0', '1', '1', '0', '1', '1']
['1', '0', '1', '1', '0', '1', 'x']
- [['1', '0', '1', '1', '0', '1', '1']]
? ^
+ [['1', '0', '1', '1', '0', '1', 'x']]
?
A note based on your question: if you're always comparing a pointer to the same array (or modifying the array in place then comparing it to itself) the result will yield true every time... so that will be a mistake.
(np.array([1, 1]) == np.array([1])).all()will yield True