Overview - Comparing values (equality, inequality)
What is it?
Comparing values means checking if two things are the same or different. In testing, we often want to see if the output of our code matches what we expect. Equality means the values are the same, and inequality means they are not the same. Using pytest, we write tests that compare values to find bugs or confirm correct behavior.
Why it matters
Without comparing values, we cannot know if our code works correctly. Imagine baking a cake without tasting it; you wouldn't know if it’s good. Similarly, tests that compare values help catch mistakes early, saving time and effort. Without these checks, software would be unreliable and frustrating to use.
Where it fits
Before learning this, you should understand basic Python syntax and how to write simple functions. After this, you can learn about more complex assertions, test fixtures, and parameterized tests to write better automated tests.