assertIsNotNone provide more helpful failure messages than
When performing checks against
None it's better to use the correct tool for the job:
assertIsNotNone are provided explicitly for this task.
The difference is assertion methods such as
assertTrue will report the message:
AssertionError: False is not True
assertIsNone will provided a much more helpful message:
AssertionError: 'foo' is not None
Good quality failure messages allows the failure mode to be understood rapidly and therefore the problem to be fixed more quickly.
If our GitHub code review bot spots this issue in your pull request it gives this advice: