Confirmed users
2,197
edits
(→Tests) |
|||
Line 188: | Line 188: | ||
* When doing equivalency assertions, put the expected value first, followed by the actual value, for example: | * When doing equivalency assertions, put the expected value first, followed by the actual value, for example: | ||
<source lang="python"> | <source lang="python"> | ||
# | assert 'expected' == 'actual' # good | ||
assert 'actual' == 'expected' # bad | |||
assert ' | </source> | ||
* When doing negative equivalency, use != and put the unexpected value first, followed by the actual value, for example: | |||
<source lang="python"> | |||
assert 'unexpected' != 'actual' # good | |||
assert | assert 'actual' != 'unexpected' # bad | ||
</source> | </source> | ||