Introduction
Assert helps check if your code works as expected. PyTest uses assert because it is simple and clear to find mistakes.
When you want to check if a function returns the right result.
When you want to make sure a value is true or false in your test.
When you want to stop a test if something is wrong.
When you want to compare two values to see if they match.
When you want to write easy-to-read tests without extra code.