You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More specific asserts generally result in more informative error
messages when tests fail. This practice is recommended by the unittest
docs:
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue
> This method should also be avoided when more specific methods are
> available (e.g. assertEqual(a, b) instead of assertTrue(a == b)),
> because they provide a better error message in case of failure.
Replace assertTrue(isinstance(...)) with assertIsInstance.
Additionally, replace truthiness checks with precise True/False checks.
This practice is also recommended by the unittest docs:
> assertTrue
>
> Note that this is equivalent to bool(expr) is True and not to expr is
> True (use assertIs(expr, True) for the latter).
Replace assertTrue(...) with assertIs(..., True).
0 commit comments