assertTrue
is not for comparing arguments. Consider assertEqual
or others instead.
The purpose of the second argument of assertTrue
is not for comparing equality with the first argument. It's actually the message that should be shown if the first argument is not truthy.
Calling assertTrue
with two objects and expecting them to be compared will not work.
If our GitHub code review bot spots this issue in your pull request it gives this advice:
1 | + | class TestFeature(unittest.TestCase): | |
2 | + | def test_feature(self): | |
3 | + | self.assertTrue(value_one, value_two) |
assertTrue
is not for comparing arguments. Consider assertEqual
or others instead.
- | self.assertTrue(value_one, value_two) |
+ | self.assertEqual(value_one, value_two) |