assert vs == for testing code in Python?
Question: What is the need for importing unittest and running assertTrue (for example)
while testing a python function instead of writing a usual python function
with == True check for testing? What is the new thing about unittesting, as
even the test cases have to be written by user, which can be checked by ==
instead of assert family of functions in unittest? My question basically is:
assert in unittest vs the equality check operation == in Python.


Answer: I would say that the most interesting thing is the "easy-to-test" that the
unittest package (as well as others, for example pytest) provides. When using
unittest you can just run a command and check if your refactoring or your last
feature broke something on the rest of the program. I would read something
about [test-driven development](https://en.wikipedia.org/wiki/Test-
driven_development) to understand better what is the importance of
unittesting.

