There are functions: assertSequenceEqual
, assertListEqual
and assertTupleEqual
in unittest module.
But how can I achive the opposite behavior? How can I assert that lists are unequal?
Those functions are actually used by TestCase.assertEqual()
, when both values are the same type and a type-specific method is present.
The inverse is simply to use TestCase.assertNotEqual()
.
There are no nice 'formatting' options in that case, but if the test fails, that'd means that both lists were equal, so there is no point in showing how they match exactly!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With