An assertion is an executable check of a condition. In Python, assert continues when the condition is true and raises AssertionError when it is false; it checks validity rather than producing a Boolean value. section 2.1.2 section 2.1.3
Assertions can check that a formatted string matches an expected value or that a function returns the expected result. For custom class instances, their dictionary representations can be compared as a proxy for equality. section 2.1.2 section 13.3.1
assert create_task("Laundry,3").__dict__ == Task("Laundry", 3).__dict__
This check compares the created task’s attributes with those of an expected task. section 13.3.1














