forked from spyder-ide/spyder-unittest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of writing events for each phase (setup, call, teardown) of a test (and eventually displaying them in the datatree widget) we now accumulate results over the individual test phases and only then write the final result of the entire test upon test completion using the pytest_runtest_logfinish hook. This ensures the following: 1) Capturing of output from the teardown phase even if it passes without an error. This fixes spyder-ide#127. 2) Differentiating between the outcome of the test itself (the call phase) and the entire test as a whole. An error during teardown, for instance, used to overwrite the (potentially passed) test result of the call phase. Now we get a passed test with an error during teardown. So in the datatree widget, the test status (first column) is no longer 1:1 linked with the color of this line (see also 3)). 3) Better handling of xfailed and xpassed tests which now show the correct status `xfailed` or `xpassed` and are colored green and red respectively (instead of status `skipped` and gray color for both of them). This fixes spyder-ide#47. 4) Better messages: the first message, which is usually the most important one, will be placed in the message column of the datatree widget. Further messages will be _appended_ to the extra_text field (instead of overwriting messages from previous test phases). If the first message spans over multiple lines then only its first line will be displayed in the message column and the complete message will be repeated in the extra_text field for better readability. This improves the visual impression of the datatree widget so that each (collapsed) row is exactly one line high.
- Loading branch information
Showing
2 changed files
with
64 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters