failure report
What the test runner prints when a test fails: which test, which line, and the values that did not match.
In more detail
In pytest a failure report shows a letter F in the progress line, a banner with the test name, the reprinted test body with the failing line marked by a greater-than sign, lines starting with E that show the evaluated values, and the file and line number. A good report lets you form a hypothesis without opening the test file.
Example
E assert 1250 == 1200Related terms
- stack trace — The list of function calls that were running when an error happened, printed to help a developer find where it came from; Python calls it a traceback.
- --tb — The pytest option that chooses how much of each failure's traceback to print, from long to short to none.
- short test summary — The block at the end of a pytest run that lists each failed, skipped or expected-to-fail test on one line.
- assertion rewriting — pytest's trick of rewriting plain assert statements as it imports test files so failures print the values involved.
Taught in
- The Cost And Value Of A Test — Automated Testing, TDD & Quality Engineering
- Arrange, Act, Assert — Automated Testing, TDD & Quality Engineering
- Making Failures Explain Themselves — Automated Testing, TDD & Quality Engineering