The test case specific result. Stores the result of the actual test case. Also stores the test case name.
| 145 | |
| 146 | |
| 147 | class TestCaseResult(BaseResult, FixtureResult): |
| 148 | """ |
| 149 | The test case specific result. |
| 150 | Stores the result of the actual test case. |
| 151 | Also stores the test case name. |
| 152 | """ |
| 153 | |
| 154 | test_case_name: str |
| 155 | |
| 156 | def __init__(self, test_case_name: str): |
| 157 | super(TestCaseResult, self).__init__() |
| 158 | self.test_case_name = test_case_name |
| 159 | |
| 160 | def update(self, result: Result, error: Exception | None = None) -> None: |
| 161 | self.result = result |
| 162 | self.error = error |
| 163 | |
| 164 | def _get_inner_errors(self) -> list[Exception]: |
| 165 | if self.error: |
| 166 | return [self.error] |
| 167 | return [] |
| 168 | |
| 169 | def add_stats(self, statistics: Statistics) -> None: |
| 170 | statistics += self.result |
| 171 | |
| 172 | def __bool__(self) -> bool: |
| 173 | return bool(self.setup_result) and bool(self.teardown_result) and bool(self.result) |
| 174 | |
| 175 | |
| 176 | class TestSuiteResult(BaseResult): |