Creates Result instance. When reduction is passed it tries to drop some parts of the result to save memory and time needed to send the result across process boundary. None disables reduction and full result is created.
(self, has_unexpected_output, output, reduction)
| 33 | return self.get_outcome(output) not in self.expected_outcomes |
| 34 | |
| 35 | def _create_result(self, has_unexpected_output, output, reduction): |
| 36 | """Creates Result instance. When reduction is passed it tries to drop some |
| 37 | parts of the result to save memory and time needed to send the result |
| 38 | across process boundary. None disables reduction and full result is created. |
| 39 | """ |
| 40 | if reduction == DROP_RESULT: |
| 41 | return None |
| 42 | error_details = \ |
| 43 | self._get_error_details(output) if has_unexpected_output else None |
| 44 | if reduction == DROP_OUTPUT: |
| 45 | return Result(has_unexpected_output, None, error_details=error_details) |
| 46 | if not has_unexpected_output: |
| 47 | if reduction == DROP_PASS_OUTPUT: |
| 48 | return Result(has_unexpected_output, None) |
| 49 | if reduction == DROP_PASS_STDOUT: |
| 50 | return Result(has_unexpected_output, output.without_text()) |
| 51 | |
| 52 | return Result(has_unexpected_output, output, error_details=error_details) |
| 53 | |
| 54 | def get_outcome(self, output): |
| 55 | if output.HasCrashed(): |
no test coverage detected